Bug 41005 - setSoftMask does not with with rotated or translated ctm
Summary: setSoftMask does not with with rotated or translated ctm
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
: 28637 32117 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-19 04:56 UTC by Adrian Johnson
Modified: 2011-10-17 01:38 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (11.54 KB, application/pdf)
2011-09-19 04:57 UTC, Adrian Johnson
Details
fix setSoftMask (3.87 KB, patch)
2011-09-19 04:58 UTC, Adrian Johnson
Details | Splinter Review
fix softmask (4.83 KB, patch)
2011-09-20 06:44 UTC, Adrian Johnson
Details | Splinter Review
fix softmask bug when the ctm changes (2.03 KB, patch)
2011-09-30 05:15 UTC, Adrian Johnson
Details | Splinter Review
save mask matrix on mask stack (1.42 KB, patch)
2011-10-02 04:18 UTC, Adrian Johnson
Details | Splinter Review
ensure mask matrix is always set when mask is set (1.58 KB, patch)
2011-10-02 04:19 UTC, Adrian Johnson
Details | Splinter Review
0005-cairo-implement-transfer-function-in-setSoftMask.patch (1.77 KB, patch)
2011-10-08 02:01 UTC, Adrian Johnson
Details | Splinter Review

Description Adrian Johnson 2011-09-19 04:56:54 UTC
Test case attached. The problem is CairoOutputDev::setSoftMask creates in image mask using the clip extents transformed to device space. There are two bugs:

- The transformation of clip extents to device space is only transforming two corners then getting the bounding box around the two corners. If, for example, the clip extents is a square rotated 45 degrees, the bounding box around the two transformed corners is now a straight line.

- The mask surface origin starts at the clip extents origin, not (0,0). But there is no translation applied when painting the source onto the mask surface to compensate for the non zero origin.
Comment 1 Adrian Johnson 2011-09-19 04:57:29 UTC
Created attachment 51331 [details]
test case
Comment 2 Adrian Johnson 2011-09-19 04:58:52 UTC
Created attachment 51332 [details] [review]
fix setSoftMask

Patch to fix this bug.
Comment 3 Carlos Garcia Campos 2011-09-19 11:11:03 UTC
Thanks for the patch!. I've run the regtests with my pdfs and while it fixes some documents, it breaks others too.

http://acroeng.adobe.com/Test_Files/images/a_Opera.pdf
http://acroeng.adobe.com/Test_Files/OCG/ClarityOCGs.pdf
 - It removes a shadow

discover_ireland_Boyne-Valley-Brochure-Interactive-V2-0-.pdf
 - It fixes this document, I don't remember where I got this, so I don't know whether I can share it or not. Just let me know if you want it.

http://www.investigatemagazine.com/tgif8aug08.pdf
 - It fixes this one too (see diffs in page 8)
Comment 4 Adrian Johnson 2011-09-20 06:44:30 UTC
Created attachment 51403 [details] [review]
fix softmask

Updated patch to fix regression in previous patch.
Comment 5 Adrian Johnson 2011-09-23 06:23:22 UTC
*** Bug 32117 has been marked as a duplicate of this bug. ***
Comment 6 Adrian Johnson 2011-09-30 05:15:09 UTC
Created attachment 51792 [details] [review]
fix softmask bug when the ctm changes

I've found another bug in the cairo softmask code. It was not correctly handling the case where the ctm changes after the mask is created and before calling cairo_mask().

The attached patch fixes this. This fixes bug 28637. It also makes the ducks and roses pdf in bug 22098 render almost correctly. I'm still investigating the remaining issues with the ducks and roses pdf but it appears the problem is in cairo, not poppler.
Comment 7 Adrian Johnson 2011-10-02 04:18:58 UTC
Created attachment 51874 [details] [review]
save mask matrix on mask stack
Comment 8 Adrian Johnson 2011-10-02 04:19:23 UTC
Created attachment 51875 [details] [review]
ensure mask matrix is always set when mask is set
Comment 9 Adrian Johnson 2011-10-08 02:01:18 UTC
Created attachment 52110 [details] [review]
0005-cairo-implement-transfer-function-in-setSoftMask.patch

Implement the transfer function in setSoftMask.
Comment 10 Adrian Johnson 2011-10-17 01:36:01 UTC
Patches committed.
Comment 11 Adrian Johnson 2011-10-17 01:38:56 UTC
*** Bug 28637 has been marked as a duplicate of this bug. ***


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.