Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ConicGradient angle should start at the x-axis, not at the top
https://bugs.webkit.org/show_bug.cgi?id=244254 rdar://problem/99041207 Reviewed by Said Abou-Hallawa and Aditya Keerthi. * LayoutTests/fast/canvas/canvas-conic-gradient-angle-expected.html: * LayoutTests/fast/canvas/canvas-conic-gradient-center-expected.html: * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html: * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html: * LayoutTests/inspector/canvas/recording-html-2d-expected.txt: Updating tests for conic gradient with angle starting from the x-axis. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt: Added. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt: Added. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt: Added. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker-expected.txt: Added. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt: Added. * LayoutTests/platform/gtk-wk2/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker-expected.txt: Added. Most of the related gtk-wk2 are passing now. * Source/WTF/wtf/MathExtras.h: Adding radians per turn constants. * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createConicGradient): For consistency with other canvas methods, startAngle should start from x-axis: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createconicgradient Therefore, we are adding 90 deg (pi/2 rad) to startAngle. * Source/WebCore/platform/graphics/GeometryUtilities.cpp: (WebCore::normalizeAngleInRadians): Added * Source/WebCore/platform/graphics/GeometryUtilities.h: * Source/WebCore/platform/graphics/Path.cpp: (WebCore::computeArcBounds): Moving radian angle normalization logic from Path.cpp to GeometryUtilities.cpp so it can be reused. Canonical link: https://commits.webkit.org/254038@main
- Loading branch information
1 parent
a5a7844
commit cf0a117
Showing
18 changed files
with
78 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ml/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
2d.gradient.conic.negative.rotation | ||
Conic gradient with negative rotation | ||
Actual output: | ||
Expected output: | ||
|
||
|
||
PASS Conic gradient with negative rotation | ||
|
8 changes: 8 additions & 0 deletions
8
...ml/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
2d.gradient.conic.positive.rotation | ||
Conic gradient with positive rotation | ||
Actual output: | ||
Expected output: | ||
|
||
|
||
PASS Conic gradient with positive rotation | ||
|
7 changes: 7 additions & 0 deletions
7
.../canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
2d.gradient.conic.negative.rotation | ||
|
||
Conic gradient with negative rotation | ||
|
||
|
||
PASS Conic gradient with negative rotation | ||
|
3 changes: 3 additions & 0 deletions
3
.../offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Conic gradient with negative rotation | ||
|
7 changes: 7 additions & 0 deletions
7
.../canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
2d.gradient.conic.positive.rotation | ||
|
||
Conic gradient with positive rotation | ||
|
||
|
||
PASS Conic gradient with positive rotation | ||
|
3 changes: 3 additions & 0 deletions
3
.../offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Conic gradient with positive rotation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters