Closed Bug 610122 Opened 11 years ago Closed 10 years ago
Speed up mask drawing for SVG elements
+++ This bug was initially created as a clone of Bug #586954 +++ The patch I landed in bug 586954 improves performance for non-SVG elements that have SVG masks applied to them. This bug is about speeding up the SVG case. The "part 1" patch in bug 586954, which I didn't land because of unexplained test failures, will help both the non-SVG and the SVG case, so I'll re-attach it here. When we've got those failures sorted out, the remaining piece to optimize is the PushGroup call in nsSVGUtils::PaintFrameWithEffects.
This fixes the reftest failures for me on Vista? How is it for you Marcus?
Testing on Mac, the RoundOut call doesn't seem to make a difference. (The maskArea in each of the failing tests have integral x/y/width/height to start with.)
Also note from the log in bug 586954 that the differing pixels are scattered randomly throughout the interior of the failing rect - it's not a periphery thing.
For which you need dbaron's reftest-analyzer.xhtml to see; I have a copy online at http://jwatt.org/tools/reftest-analyzer.xhtml
(FWIW, there's also always a reftest-analyzer instance available here: http://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml )
Not much else I can do then since it seems to work on Vista.
Thanks for taking a look!
I think I know what's going on: We're hitting differences between cairo's quartz and image backends. In those reftests, the test uses a mask, but the reference doesn't. The reference renders the circle and the gradient directly into the target surface. Before the patch, on Mac everything in those tests was rendered using the Quartz backend. But now that we're rendering the mask into a cairo image surface, this is done using the image backend, where anti-aliasing and gradient rasterization seem to be slightly different. If we make the reftest reference use a mask, too, the tests pass on Mac. Then both the test and the reference render the circle and the gradient using cairo's image backend.
Attachment #492325 - Flags: review?(roc)
Attachment #488657 - Attachment is obsolete: true
Comment on attachment 492192 [details] [diff] [review] speed up nsSVGMaskFrame::ComputeMaskAlpha and round out maskArea I think rounding out the clip rect is a good idea either way.
Attachment #492325 - Flags: review?(roc) → review+
Comment on attachment 492192 [details] [diff] [review] speed up nsSVGMaskFrame::ComputeMaskAlpha and round out maskArea Let's do this!
Attachment #492192 - Flags: approval2.0+
Reftests passed on all platforms in a tryserver push with the two patches.
Whiteboard: [can land]
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [can land]
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.