Bug 19790

Summary: Canvas strokeRect() doesn't support gradients
Product: WebKit Reporter: Dirk Schulze <krit>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: quark67
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
URL: http://developer.mozilla.org/samples/canvas-tutorial/4_9_canvas_lineargradient.html
Bug Depends on: 17269    
Bug Blocks:    
Attachments:
Description Flags
Gradients for strokeRect()
none
strokeRect() with gradients
none
strokeRect support for Cg
none
strokeRect support for Cg oliver: review+

Description Dirk Schulze 2008-06-27 08:38:17 PDT
strokeRect() doesn't support gradients in Canvas.
Comment 1 Dirk Schulze 2008-06-27 08:40:46 PDT
Created attachment 21972 [details]
Gradients for strokeRect()

Transformed the Rectangle to a path and let stroke() render the content of strokeRect().
Comment 2 Dirk Schulze 2008-06-27 09:29:25 PDT
(In reply to comment #1)
> Created an attachment (id=21972) [edit]
> Gradients for strokeRect()
> 
> Transformed the Rectangle to a path and let stroke() render the content of
> strokeRect().
> 

I'm unsure about lineWidth. If we let stroke() render rectangles, do we still need strokeRect(float, float, float, float, float) (5 floats)?
I believe it was used to let the rect render by GraphicsContext and isn't usefull anymore with the changes above.
Otherwise we need to call setLineWidth().
Comment 3 Dirk Schulze 2008-06-28 03:04:01 PDT
Created attachment 21984 [details]
strokeRect() with gradients

I spoke with olliej and we were agreed to clean up canvas first before fixing strokeRect() and look if the code could be reused later.
Comment 4 Dirk Schulze 2008-06-29 11:31:52 PDT
*** Bug 18463 has been marked as a duplicate of this bug. ***
Comment 5 Eric Seidel (no email) 2008-08-29 12:08:14 PDT
This still fails for CG in the latest nightly:
r35993.dmg">http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-r35993.dmg
Comment 6 Dirk Schulze 2008-12-05 13:53:00 PST
Created attachment 25786 [details]
strokeRect support for Cg

This should add patter and gradient-strokes for strokeRect(). I'll run layouttest and set the review-flag afterwards.
Comment 7 Dirk Schulze 2008-12-06 04:28:00 PST
Created attachment 25812 [details]
strokeRect support for Cg

Added a LayoutTest.
Comment 8 Dirk Schulze 2008-12-07 01:23:51 PST
landed in r39080.