Bug 55436

Summary: No shadow when stroking a path with a gradient
Product: WebKit Reporter: Helder Correia <helder>
Component: CanvasAssignee: Helder Correia <helder>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, mdelaney7, simon.fraser, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch simon.fraser: review+

Helder Correia
Reported 2011-02-28 18:32:43 PST
This happens in CG and is related to bug 52509, this time to be fixed in GraphicsContext::strokePath(). The gradient needs to be drawn clipped to the stroke on a CGLayer first, then the layer drawn on the GraphicsContext.
Attachments
Patch (129.74 KB, patch)
2011-02-28 18:41 PST, Helder Correia
simon.fraser: review+
Helder Correia
Comment 1 2011-02-28 18:41:50 PST
Simon Fraser (smfr)
Comment 2 2011-02-28 22:12:43 PST
Comment on attachment 84170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=84170&action=review > Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:616 > + const FloatRect rect = path.boundingRect(); > + const float lineWidth = strokeThickness(); > + const float doubleLineWidth = lineWidth * 2; > + const float layerWidth = ceilf(rect.width() + doubleLineWidth); > + const float layerHeight = ceilf(rect.height() + doubleLineWidth); It's not really customary to use const for local variables; just follow the style in the rest of the file. > Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:636 > + const float destinationX = roundf(rect.x() - lineWidth); > + const float destinationY = roundf(rect.y() - lineWidth); I don't think there's any point using 'const' for variables that are declared just before you use them.
Helder Correia
Comment 3 2011-03-01 15:30:47 PST
WebKit Review Bot
Comment 4 2011-03-01 16:33:10 PST
http://trac.webkit.org/changeset/80049 might have broken Qt Linux Release The following tests are not passing: fast/canvas/canvas-strokePath-gradient-shadow.html
Helder Correia
Comment 5 2011-03-01 17:18:38 PST
(In reply to comment #4) > http://trac.webkit.org/changeset/80049 might have broken Qt Linux Release > The following tests are not passing: > fast/canvas/canvas-strokePath-gradient-shadow.html The manually committed patch didn't add fast/canvas/canvas-strokePath-gradient-shadow.html to Qt Skipped by mistake. Fixed in http://trac.webkit.org/changeset/80069
Note You need to log in before you can comment on or make changes to this bug.