- Revision
- 235877
- Author
- [email protected]
- Date
- 2018-09-10 17:51:42 -0700 (Mon, 10 Sep 2018)
Log Message
Correctly interpret from angle for conic gradients
https://bugs.webkit.org/show_bug.cgi?id=189445
Reviewed by Simon Fraser
No new tests, no functionality is changing.
Just renaming angle to angleRadians to make the type more clear,
and hopefully avoid bugs in the future. Update patch to original bug
fix.
* css/CSSGradientValue.cpp:
(WebCore::CSSConicGradientValue::createGradient):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildArrayForCanvasGradient):
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::hash const):
* platform/graphics/Gradient.h:
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (235876 => 235877)
--- trunk/Source/WebCore/ChangeLog 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/ChangeLog 2018-09-11 00:51:42 UTC (rev 235877)
@@ -1,3 +1,26 @@
+2018-09-10 Megan Gardner <[email protected]>
+
+ Correctly interpret from angle for conic gradients
+ https://bugs.webkit.org/show_bug.cgi?id=189445
+
+ Reviewed by Simon Fraser
+
+ No new tests, no functionality is changing.
+
+ Just renaming angle to angleRadians to make the type more clear,
+ and hopefully avoid bugs in the future. Update patch to original bug
+ fix.
+
+ * css/CSSGradientValue.cpp:
+ (WebCore::CSSConicGradientValue::createGradient):
+ * inspector/InspectorCanvas.cpp:
+ (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
+ * platform/graphics/Gradient.cpp:
+ (WebCore::Gradient::hash const):
+ * platform/graphics/Gradient.h:
+ * platform/graphics/cg/GradientCG.cpp:
+ (WebCore::Gradient::paint):
+
2018-09-10 Youenn Fablet <[email protected]>
ontrack events should be fired even if an existing transceiver exists
Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (235876 => 235877)
--- trunk/Source/WebCore/css/CSSGradientValue.cpp 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp 2018-09-11 00:51:42 UTC (rev 235877)
@@ -1434,11 +1434,11 @@
if (!m_firstY)
centerPoint.setY(size.height() / 2);
- float angle = 0;
+ float angleRadians = 0;
if (m_angle)
- angle = m_angle->floatValue(CSSPrimitiveValue::CSS_RAD);
+ angleRadians = m_angle->floatValue(CSSPrimitiveValue::CSS_RAD);
- Gradient::ConicData data { centerPoint, angle };
+ Gradient::ConicData data { centerPoint, angleRadians };
ConicGradientAdapter adapter;
auto stops = computeStops(adapter, conversionData, renderer.style(), 1);
Modified: trunk/Source/WebCore/inspector/InspectorCanvas.cpp (235876 => 235877)
--- trunk/Source/WebCore/inspector/InspectorCanvas.cpp 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/inspector/InspectorCanvas.cpp 2018-09-11 00:51:42 UTC (rev 235877)
@@ -635,7 +635,7 @@
[¶meters] (const Gradient::ConicData& data) {
parameters->addItem(data.point0.x());
parameters->addItem(data.point0.y());
- parameters->addItem(data.angle);
+ parameters->addItem(data.angleRadians);
}
);
Modified: trunk/Source/WebCore/platform/graphics/Gradient.cpp (235876 => 235877)
--- trunk/Source/WebCore/platform/graphics/Gradient.cpp 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/platform/graphics/Gradient.cpp 2018-09-11 00:51:42 UTC (rev 235877)
@@ -223,7 +223,7 @@
float startRadius;
float endRadius;
float aspectRatio;
- float angle;
+ float angleRadians;
GradientSpreadMethod spreadMethod;
AffineTransform gradientSpaceTransformation;
} parameters;
@@ -243,7 +243,7 @@
parameters.startRadius = 0;
parameters.endRadius = 0;
parameters.aspectRatio = 0;
- parameters.angle = 0;
+ parameters.angleRadians = 0;
parameters.type = Type::Linear;
},
[¶meters] (const RadialData& data) {
@@ -252,7 +252,7 @@
parameters.startRadius = data.startRadius;
parameters.endRadius = data.endRadius;
parameters.aspectRatio = data.aspectRatio;
- parameters.angle = 0;
+ parameters.angleRadians = 0;
parameters.type = Type::Radial;
},
[¶meters] (const ConicData& data) {
@@ -261,7 +261,7 @@
parameters.startRadius = 0;
parameters.endRadius = 0;
parameters.aspectRatio = 0;
- parameters.angle = data.angle;
+ parameters.angleRadians = data.angleRadians;
parameters.type = Type::Conic;
}
);
Modified: trunk/Source/WebCore/platform/graphics/Gradient.h (235876 => 235877)
--- trunk/Source/WebCore/platform/graphics/Gradient.h 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/platform/graphics/Gradient.h 2018-09-11 00:51:42 UTC (rev 235877)
@@ -88,7 +88,7 @@
struct ConicData {
FloatPoint point0;
- float angle;
+ float angleRadians;
};
using Data = "" RadialData, ConicData>;
Modified: trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp (235876 => 235877)
--- trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp 2018-09-11 00:44:15 UTC (rev 235876)
+++ trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp 2018-09-11 00:51:42 UTC (rev 235877)
@@ -134,7 +134,7 @@
CGContextTranslateCTM(platformContext, data.point0.x(), data.point0.y());
CGContextRotateCTM(platformContext, (CGFloat)-M_PI_2);
CGContextTranslateCTM(platformContext, -data.point0.x(), -data.point0.y());
- CGContextDrawConicGradient(platformContext, platformGradient(), data.point0, data.angle);
+ CGContextDrawConicGradient(platformContext, platformGradient(), data.point0, data.angleRadians);
CGContextRestoreGState(platformContext);
#else
UNUSED_PARAM(data);