Bug 132949 - [CANVAS] Gradients don't apply correctly in combination with some compositing modes
Summary: [CANVAS] Gradients don't apply correctly in combination with some compositing...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Unspecified
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/386sM/1/
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 05:16 PDT by Branimir Lambov
Modified: 2014-07-24 17:31 PDT (History)
1 user (show)

See Also:


Attachments
Safari rendering (11.79 KB, image/png)
2014-05-15 05:17 PDT, Branimir Lambov
no flags Details
Expected rendering (14.44 KB, image/png)
2014-05-15 05:17 PDT, Branimir Lambov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Branimir Lambov 2014-05-15 05:16:38 PDT
The linked fiddle tries to draw a stroke with a paint that requires transformation by drawing a black stroke followed by a 'source-in' fill, where the paint is a linear gradient.

Safari incorrectly paints the stroke in the final color of the gradient instead of rendering the gradient. This happens when source-in, source-out or destination-atop compositing mode is used.

The fiddle should result in two rectangles that look the same (the second one is stroked using the gradient directly, which is not always possible (e.g. for radial gradients with non-uniform scales)). The test works fine on Chrome on any platform, as well as Firefox and Opera on Linux. It fails on Safari MacOS and iOS (tested on MacOS 10.9.2, version 7.0.3, as well as iOS 7.1.1).

See also
http://jsfiddle.net/386sM/2/  (using source-atop to work around the problem for opaque paints, also swapping + destination in which is even more broken)
http://jsfiddle.net/386sM/5/  (testing all compositing modes for fill() and stroke())
Comment 1 Branimir Lambov 2014-05-15 05:17:28 PDT
Created attachment 231501 [details]
Safari rendering
Comment 2 Branimir Lambov 2014-05-15 05:17:59 PDT
Created attachment 231502 [details]
Expected rendering
Comment 3 Branimir Lambov 2014-05-15 05:22:24 PDT
Note: the Safari output is also affected by
https://bugs.webkit.org/show_bug.cgi?id=132948
Comment 4 Nikos Andronikos 2014-07-24 17:23:06 PDT

*** This bug has been marked as a duplicate of bug 129791 ***
Comment 5 Nikos Andronikos 2014-07-24 17:31:24 PDT
(In reply to comment #4)
> 
> *** This bug has been marked as a duplicate of bug 129791 ***

Wrong duplicate entry - however I have checked that the issue was fixed before  before revision 170906