Last Comment Bug 769103 - Get SVG masks working for HTML elements under CSS transforms
: Get SVG masks working for HTML elements under CSS transforms
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Jonathan Watt [:jwatt] (back in October - email directly if necessary)
:
:
Mentors:
Depends on:
Blocks: 614732
  Show dependency treegraph
 
Reported: 2012-06-27 17:06 PDT by Jonathan Watt [:jwatt] (back in October - email directly if necessary)
Modified: 2012-06-29 00:46 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (5.29 KB, patch)
2012-06-27 17:16 PDT, Jonathan Watt [:jwatt] (back in October - email directly if necessary)
roc: review+
Details | Diff | Splinter Review
patch (6.81 KB, patch)
2012-06-28 03:14 PDT, Jonathan Watt [:jwatt] (back in October - email directly if necessary)
roc: review+
Details | Diff | Splinter Review

Description Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2012-06-27 17:06:18 PDT
nsSVGMaskFrame::ComputeMaskAlpha doesn't account for transforms that are already applied to the gfxContext that is being painting to. For elements that are under a CSS transform that's scales the element up, this means that it creates surfaces that are too small (or, more to the point, surfaces that don't have enough resolution) when creating the mask pattern it returns. As a result, the more the element is scaled up, the more pixelated the masking becomes.

This isn't generally a problem for SVG, since the transforms aren't accumulated on the gfxMatrix as we descend down the tree. However, when switching to display list painting of SVG, we do accumulate the transforms as we descend the tree, and this bug causes various SVG reftests to fail.
Comment 1 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2012-06-27 17:16:35 PDT
Created attachment 637318 [details] [diff] [review]
patch
Comment 2 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2012-06-28 03:14:33 PDT
Created attachment 637440 [details] [diff] [review]
patch

Actually, that's not right. While falling asleep last night I got to wondering why I could use SetDeviceOffset() at all, and this morning I came up with a test that proves that I shouldn't be. Here's a new patch to fix that, along with that test.
Comment 3 Ed Morley [:emorley] 2012-06-29 00:46:08 PDT
https://hg.mozilla.org/mozilla-central/rev/59d39ce427e2

Note You need to log in before you can comment on or make changes to this bug.