Bug 10817

Summary: <pattern> should not use CGLayer (30% of our time drawing patterns in large SVG)
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P4    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   

Eric Seidel (no email)
Reported 2006-09-11 19:28:34 PDT
<pattern> should not use CGLayer (30% of our time drawing patterns in large SVG) This was plan.svg (Interesting to note Mozilla's analysis thereof: http://weblogs.mozillazine.org/tor/archives/2006/04/) A much better solution would be to raster the pattern down to a bitmap, thus allowing CG to just blit the bitmap every time the pattern is used.
Attachments
Eric Seidel (no email)
Comment 1 2006-09-11 19:31:04 PDT
I have a shark file if someone wants to see it. Unfortunately it's 2.7 MB. 0.1% 69.9% WebCore WebCore::RenderPath::paint(WebCore::RenderObject::PaintInfo&, int, int) 0.0% 57.2% WebCore WebCore::KRenderingPaintServerPatternQuartz::draw(WebCore::KRenderingDeviceContext*, WebCore::RenderPath const*, WebCore::KCPaintTargetType) const 0.0% 57.1% WebCore WebCore::KRenderingPaintServerPatternQuartz::renderPath(WebCore::KRenderingDeviceContext*, WebCore::RenderPath const*, WebCore::KCPaintTargetType) const 27.1% 57.1% WebCore WebCore::KRenderingPaintServerQuartzHelper::fillPath(CGContext*, WebCore::RenderPath const*) 30.0% 30.0% WebCore WebCore::patternCallback(void*, CGContext*) 0.0% 0.0% WebCore WebCore::KCanvasImageQuartz::cgLayer()
Nikolas Zimmermann
Comment 2 2006-12-19 12:04:53 PST
Pattterns don't use CGLayer anymore in ToT.
Eric Seidel (no email)
Comment 3 2006-12-21 03:50:13 PST
I'm not sure this truly counts as resolved. We've just shifted the timing to a different CG call now. I wrote a mail about this to several webkit folks: 1. 50% of the time is spent filling paths. Looking at the sample, it's all down in CG pattern code. I originally suspected that this was due to webkit blowing away CGPattern-related caches every time draw by destroying the CGPattern object in teardown(). (Ideally WebKit should cache the CGPattern object on the SVGPaintServerPatternCg instance, and only regenerate it when the paintserver changes.) But I made a quick hack to keep m_pattern around, and yet I still see 50% of the time spent filling paths. WebKit may still be blowing away those caches more often that I expect (by resetting the tile, or destroying the paintserver), or something else could be wrong. Oliver might want to chat with Andrew B. We (I) can file a separate bug to track such if you like.
Eric Seidel (no email)
Comment 4 2006-12-21 04:04:54 PST
I filed bug 10817 as a followup.
Note You need to log in before you can comment on or make changes to this bug.