Bug 95235 - Cairo 1.14.4: wrong rasterization for concave shapes with cairo_mesh_pattern
Summary: Cairo 1.14.4: wrong rasterization for concave shapes with cairo_mesh_pattern
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-02 08:02 UTC by s.brodacka
Modified: 2016-05-05 09:41 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
minimal example (2.40 KB, text/plain)
2016-05-02 08:02 UTC, s.brodacka
Details

Description s.brodacka 2016-05-02 08:02:41 UTC
Created attachment 123402 [details]
minimal example

Cairo sometimes cuts the concavity of shape if the cairo_mesh_pattern is used for rasterization. It looks like extra point is created on the shape to close the pattern and additional shape is rasterized to fill it.
If the standard drawing method is used the shape is fine.
Minimal example of cairo_mesh_pattern (red) rasterization summarized with standard rasterization (black) showing the difference in rasterized shape is attached.
Comment 1 Adrian Johnson 2016-05-02 12:52:24 UTC
That is the correct rendering when the patch folds over. Confirmed by changing the surface to a PDF surface and checking the rendering of the generated PDF with both Ghostscript and Adobe Reader.

See figure 29, p195 of the PDF standard:

http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
Comment 2 s.brodacka 2016-05-05 09:27:54 UTC
(In reply to Adrian Johnson from comment #1)
> That is the correct rendering when the patch folds over. Confirmed by
> changing the surface to a PDF surface and checking the rendering of the
> generated PDF with both Ghostscript and Adobe Reader.
> 
> See figure 29, p195 of the PDF standard:
> 
> http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.
> pdf

Thank you for your answear. So is there a possibility to draw the exact shape using cairo_mesh_pattern?
Comment 3 Adrian Johnson 2016-05-05 09:41:21 UTC
If it is just one patch you could set a clip path around the patch.

The better solution would be to subdivide the patch to eliminate beziers that change direction.


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.