Bug 43622 - SVG masking performance very slow
Summary: SVG masking performance very slow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nikolas Zimmermann
URL: http://ie.microsoft.com/testdrive/Per...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-06 08:03 PDT by Stephen White
Modified: 2010-08-13 01:14 PDT (History)
3 users (show)

See Also:


Attachments
Patch (378.13 KB, patch)
2010-08-12 02:04 PDT, Nikolas Zimmermann
krit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen White 2010-08-06 08:03:40 PDT
The above page (once initialized) renders quite fast in Firefox.  In WebKit, it hangs for many seconds each frame.  It seems to be computing a luminance mask for a 5Kx5K image every frame.  Although mask creation could be optimized, I doubt that the other browsers are doing this computation, due to its size.  I suspect that either we're doing it at the wrong resolution, or there is an invalidation issue and the mask is being computed more often than necessary.
Comment 1 Nikolas Zimmermann 2010-08-06 09:06:01 PDT
This also affects clipPaths that may use ImageBuffers, filters and patterns.
We're not allocating image buffers based on the final rendered size, but in the intermediate coordinate system where the object is renderer. This leads to scaling artefacts as well (see similar pattern bugs).

We should try to fix this ASAP.
Comment 2 Nikolas Zimmermann 2010-08-06 09:06:47 PDT
I forgot to ask: Stephen, do you want to work on this?
There's already some code handling the task to figure out the final renderered size in the CG code path in RenderSVGResourceGradient (used for gradient on text).
Comment 3 Stephen White 2010-08-06 09:11:39 PDT
(In reply to comment #2)
> I forgot to ask: Stephen, do you want to work on this?

I'm afraid I'm heavily loaded with other tasks right now, so I was hoping that someone else could take it on.
Comment 4 Dirk Schulze 2010-08-09 00:42:23 PDT
Niko and me began at the same time to fix this issue. Delegating this work to Niko.
Comment 5 Nikolas Zimmermann 2010-08-12 02:04:06 PDT
Created attachment 64195 [details]
Patch
Comment 6 Early Warning System Bot 2010-08-12 02:10:18 PDT
Attachment 64195 [details] did not build on qt:
Build output: http://queues.webkit.org/results/3763096
Comment 7 Dirk Schulze 2010-08-12 02:55:17 PDT
Comment on attachment 64195 [details]
Patch

The qt-build system update is missing. Otherwise looks great r=me.
Comment 8 Nikolas Zimmermann 2010-08-12 03:11:26 PDT
Qt build system updated. Landed in r65229.