Bug 43622

Summary: SVG masking performance very slow
Product: WebKit Reporter: Stephen White <senorblanco>
Component: Layout and RenderingAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: krit, webkit-ews, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://ie.microsoft.com/testdrive/Performance/SVGDice/Default.xhtml
Attachments:
Description Flags
Patch krit: review+

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.