Bug 10050

Summary: Incomplete EXTEND_PAD support
Product: cairo Reporter: Elfi Heck <eheck>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.2.4   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: test code
resulting image when running test code

Description Elfi Heck 2007-02-21 04:04:54 UTC
I'm drawing an image onto a surface (via pattern). The image should be scaled up by a large value. When the pattern has a filter value other than CAIRO_FILTER_FAST the image will not come out as expected. If the target surface has an alpha channel edge pixels will be transparent, if not they will be black. They seem to be interpolated with an imaginary black pixel outside the image border. To make the image look good, the imaginary pixel should have the same color as the original edge pixel.
Is there a workaround? I've seen people use CAIRO_EXTEND_REFLECT and clipping but as we know from another lengthy discussion elsewhere :-) EXTEND_REFLECT is broken in 1.2.
Comment 1 Elfi Heck 2007-02-21 04:06:45 UTC
Created attachment 8798 [details]
test code

test code drawing an image onto another image using large scaling values
Comment 2 Elfi Heck 2007-02-21 04:18:34 UTC
Created attachment 8799 [details]
resulting image when running test code
Comment 3 Behdad Esfahbod 2007-02-21 08:55:06 UTC
What you want is exactly what CAIRO_EXTEND_PAD does.  We've discussed about making that the default, but that is considered API change and was avoided.  Maybe we should add a bit more documentation?  Tell us about your documentation use.  Did you see CAIRO_EXTEND_PAD and ignored it?
Comment 4 Elfi Heck 2007-02-21 09:30:00 UTC
For documentation I use the API reference manual and the sample snippets because I never know what to look for in the guides and tutorials. I've seen EXTEND_PAD but my cairo.h says that it's not implemented for surface patterns so I didn't bother trying.
I've added it now to my test code anyway and I'm getting a completely black image as if nothing is painted at all.
Comment 5 Behdad Esfahbod 2007-02-22 10:46:31 UTC
Right...  I'm working on fixing this, with no luck so far.

What I did fix however is CAIRO_EXTEND_REFLECT for surface patterns.  That will be in 1.4.  With that, you can get the effect you want by using REFLECT and cliping.
Comment 6 Chris Wilson 2013-02-15 00:47:18 UTC
Actually fixed in pixman awhile ago.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.