Bug 132950 - [CANVAS] Strokes do not render correctly when a globalCompositeOperation is in effect
Summary: [CANVAS] Strokes do not render correctly when a globalCompositeOperation is i...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/386sM/5/
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 05:33 PDT by Branimir Lambov
Modified: 2022-07-18 14:47 PDT (History)
2 users (show)

See Also:


Attachments
Test (1.84 KB, text/html)
2014-05-15 05:33 PDT, Branimir Lambov
no flags Details
Safari rendering (121.33 KB, image/png)
2014-05-15 05:33 PDT, Branimir Lambov
no flags Details
Expected rendering (83.47 KB, image/png)
2014-05-15 05:34 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:33:12 PDT
Created attachment 231505 [details]
Test

Applying a stroke after globalCompositeOperation has been set to destination-in, destination-atop, source-in, source-out or copy does not result in correct rendering.

See the attached file and/or fiddle. It draws pairs of canvases, one doing a stroke, setting compositing, then filling, the other filling, setting the complementing compositing mode, then stroking.

What is the expected behavior?
The pairs should be the same, e.g. stroke, source-in, fill should be the same as fill, dest-in, stroke.

What went wrong?
The stroke doesn't appear to be applied in the destination-in, destination-atop cases and does the wrong thing for source-in, source-out and copy.

The rendering is correct on Opera 12 and Firefox 29 Linux and is also broken on Chrome 34 (https://code.google.com/p/chromium/issues/detail?id=373692). The current Safari output is also badly affected by https://bugs.webkit.org/show_bug.cgi?id=132948 and https://bugs.webkit.org/show_bug.cgi?id=132949.

Safari is broken on both MacOS 10.9.2 (Safari 7.0.3) and iOS 7.1.1.
Comment 1 Branimir Lambov 2014-05-15 05:33:56 PDT
Created attachment 231506 [details]
Safari rendering
Comment 2 Branimir Lambov 2014-05-15 05:34:23 PDT
Created attachment 231507 [details]
Expected rendering
Comment 3 Brent Fulgham 2022-07-18 14:47:35 PDT
Safari 16 now matches the expected rendering.