Bug 6564

Summary: SVGPaintServer system needs to be redesigned to fill & stroke simultaneously
Product: WebKit Reporter: Alexander Kellett <a>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: ian, krit
Priority: P4    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on: 6553    
Bug Blocks:    

Description Alexander Kellett 2006-01-15 11:22:10 PST
KCanvas needs to be redesigned to fill & stroke at once

This is a continuation of 6553.

Items remaining:

1.  Update PaintServers to not paint directly, but rather have an apply(STROKE | FILL) method which 
applies their stoke/fill properties to the current context.
2.  Change RenderPathQuartz to call CGContextDrawPath, and thus both stroke and fill a path in a 
single call (large perf. gain).
Comment 1 Eric Seidel (no email) 2006-01-26 16:13:57 PST
This could be a big performance win on large SVGs.
Comment 2 Eric Seidel (no email) 2006-12-26 17:23:25 PST
This is nearly possible today.  Just a few adjustments would be necessary.  Here's some pseudo code:

fill = fillPaintServer()
stroke = strokePaintServer()

if (fill == stroke) {
    fill->setup()
    fill->renderPath(FILL_MODE | STROKE_MODE)
    fill->teardown()
} else {
    fill->setup()
    fill->renderPath(FILL_MODE)
    fill->teardown()
    
    stroke->setup()
    stroke->renderPath(STROKE_MODE)
    stroke->teardown()
}

I'm not certain how huge of a performance win this would be, but now that we have an SVG PLT we can check. ;)
Comment 3 Dirk Schulze 2011-05-18 10:10:55 PDT
I doubt that it makes sense to implement it. We need to be able to apply different transforms to the context for fill or stroke (because of gradients, patterns, non-scaling-stroke). And IIRC this won't be able with drawing fill and stroke at once for CG. Also just CG could make use of this. Because of the cost to implement it and the fact that just CG could make use of it. I mark this as WONTFIX. Feel free to reopen the bug if you want to work on that.