Bug 20729

Summary: [Qt] Canvas gradients don't work as expected
Product: WebKit Reporter: Dirk Schulze <krit>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hausmann
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
URL: http://developer.mozilla.org/samples/canvas-tutorial/4_10_canvas_radialgradient.html
Attachments:
Description Flags
Qt radial gradients
none
Qt gradients
hausmann: review-
Qt gradients hausmann: review+

Description Dirk Schulze 2008-09-08 10:52:03 PDT
Radial gradients are broken on Qt. Center and focal point are mixed up and the radius of the start circle is not supported by Qt.
Comment 1 Dirk Schulze 2008-09-08 10:53:01 PDT
Created attachment 23266 [details]
Qt radial gradients

fixed radial gradients on Qt
Comment 2 Dirk Schulze 2008-09-10 00:06:22 PDT
Created attachment 23314 [details]
Qt gradients

reused old canvas-code to get multiple color-stops with the same offset to work:
http://developer.mozilla.org/samples/canvas-tutorial/4_9_canvas_lineargradient.html

and added the code above to support the inner radius as well as the outer radius on Canvas:
http://developer.mozilla.org/samples/canvas-tutorial/4_10_canvas_radialgradient.html

-> gradients fixed
Comment 3 Simon Hausmann 2008-09-10 12:52:12 PDT
Comment on attachment 23314 [details]
Qt gradients

Looks good, but there's a small coding style nitpick:

If (qFuzzyCompare(...)) {
   one line of code
} else
   another line of code

There's no need for braces in one-liners
Comment 4 Dirk Schulze 2008-09-10 13:09:31 PDT
Created attachment 23326 [details]
Qt gradients

deleted braces :-)
Comment 5 Simon Hausmann 2008-09-11 00:30:44 PDT
Comment on attachment 23326 [details]
Qt gradients

Thanks!
Comment 6 Simon Hausmann 2008-09-11 00:37:54 PDT
Landed in r36330