Bug 20729 - [Qt] Canvas gradients don't work as expected
Summary: [Qt] Canvas gradients don't work as expected
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL: http://developer.mozilla.org/samples/...
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2008-09-08 10:52 PDT by Dirk Schulze
Modified: 2008-09-11 00:37 PDT (History)
1 user (show)

See Also:


Attachments
Qt radial gradients (1.70 KB, patch)
2008-09-08 10:53 PDT, Dirk Schulze
no flags Details | Formatted Diff | Diff
Qt gradients (1.94 KB, patch)
2008-09-10 00:06 PDT, Dirk Schulze
hausmann: review-
Details | Formatted Diff | Diff
Qt gradients (1.93 KB, patch)
2008-09-10 13:09 PDT, Dirk Schulze
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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