Bug 132950

Summary: [CANVAS] Strokes do not render correctly when a globalCompositeOperation is in effect
Product: WebKit Reporter: Branimir Lambov <blambov>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, nikos.andronikos
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jsfiddle.net/386sM/5/
Attachments:
Description Flags
Test
none
Safari rendering
none
Expected rendering none

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.