Bug 223176

Summary: Enable the layout test 2d.path.stroke.scale2.html
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: CanvasAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 222835    
Attachments:
Description Flags
test case
none
test case
none
Patch
none
Patch
thorton: review+
Patch none

Description Said Abou-Hallawa 2021-03-15 01:36:23 PDT
Created attachment 423146 [details]
test case

This test exists in the following locations:

canvas/philip/tests/2d.path.stroke.scale2.html
imported/w3c/canvas/2d.path.stroke.scale2.html
imported/w3c/web-platform-tests/html/canvas/element/path-objects/2d.path.stroke.scale2.html

These layout tests are now fixed on macOS and iOS after enabling GPUP for 2D canvas rendering. The reason is CGPathAddRect() has a bug. Encoding the CGPath converts the rectangle command to moveTo and lineTo commands.

In the attached test case, the left canvas is drawn incorrectly if GPUP for 2D canvas rendering is disabled. The right canvas is drawn correctly because the "ctx2.rect()" is preceded by the workaround "ctx2.moveTo()".
Comment 1 Said Abou-Hallawa 2021-03-15 01:37:55 PDT
Created attachment 423147 [details]
test case
Comment 2 Said Abou-Hallawa 2021-03-15 01:45:25 PDT
rdar://75419465 is the internal radar which tracks the CGPathAddRect() bug.
Comment 3 Said Abou-Hallawa 2021-03-15 01:46:52 PDT
Created attachment 423148 [details]
Patch
Comment 4 Said Abou-Hallawa 2021-03-15 11:06:26 PDT
Created attachment 423202 [details]
Patch
Comment 5 Tim Horton 2021-03-15 12:02:09 PDT
Comment on attachment 423202 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423202&action=review

> LayoutTests/ChangeLog:9
> +        2D canvas rendering. The reason is CGPathAddRect() has a bug. Encoding

Did you file a bug about the bug you discovered?
Comment 6 Said Abou-Hallawa 2021-03-15 12:08:30 PDT
Comment on attachment 423202 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423202&action=review

>> LayoutTests/ChangeLog:9
>> +        2D canvas rendering. The reason is CGPathAddRect() has a bug. Encoding
> 
> Did you file a bug about the bug you discovered?

yes it is rdar://75419465. I will update the change log to include it.
Comment 7 Said Abou-Hallawa 2021-03-15 12:16:34 PDT
Created attachment 423217 [details]
Patch
Comment 8 EWS 2021-03-15 13:11:52 PDT
Committed r274434: <https://commits.webkit.org/r274434>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423217 [details].
Comment 9 Radar WebKit Bug Importer 2021-03-15 13:12:15 PDT
<rdar://problem/75443379>