[webkit-changes] [WebKit/WebKit] a222ea: Merge 254038 at main - ConicGradient angle should sta...
Adrian Perez
noreply at github.com
Tue Sep 6 09:02:10 PDT 2022
Branch: refs/heads/webkitglib/2.38
Home: https://github.com/WebKit/WebKit
Commit: a222eab8754ded39df6123d016e16fadf0b3bfd4
https://github.com/WebKit/WebKit/commit/a222eab8754ded39df6123d016e16fadf0b3bfd4
Author: Vitor Roriz <vitor.roriz at apple.com>
Date: 2022-09-06 (Tue, 06 Sep 2022)
Changed paths:
M LayoutTests/fast/canvas/canvas-conic-gradient-angle-expected.html
M LayoutTests/fast/canvas/canvas-conic-gradient-center-expected.html
M LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html
M LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html
M LayoutTests/inspector/canvas/recording-html-2d-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation-expected.txt
A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker-expected.txt
M Source/WTF/wtf/MathExtras.h
M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
M Source/WebCore/platform/graphics/GeometryUtilities.cpp
M Source/WebCore/platform/graphics/GeometryUtilities.h
M Source/WebCore/platform/graphics/Path.cpp
Log Message:
-----------
Merge 254038 at main - 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
(cherry picked from commit cf0a117f4760fd9c36ba296a7724e524bf4d3027)
More information about the webkit-changes
mailing list