Closed Bug 610122 Opened 14 years ago Closed 14 years ago

Speed up mask drawing for SVG elements

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b8

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Keywords: perf)

Attachments

(2 files, 1 obsolete file)

+++ 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 caused reftest failures, log is in attachment 487860 [details].
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.
Attachment #492192 - Attachment description: better? → no better
Attachment #492192 - Attachment is obsolete: true
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 #492192 - Attachment description: no better → speed up nsSVGMaskFrame::ComputeMaskAlpha and round out maskArea
Attachment #492192 - Attachment is obsolete: false
Assignee: nobody → mstange
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.
Keywords: checkin-needed
Whiteboard: [can land]
http://hg.mozilla.org/mozilla-central/rev/ac9517000604
http://hg.mozilla.org/mozilla-central/rev/ef00cc458294
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
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.

Attachment

General

Created:
Updated:
Size: