Switch the gradient drawing code to use bearing angles
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2012 23:34:31 +0000 (23:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2012 23:34:31 +0000 (23:34 +0000)
commit57b43a74e6fc47233b7e89ed178dd6ecc86e4f35
tree95970703819d498ecdc3e837b3b06e9546d7bff2
parent2692f5fd3b09190834db6884586996282970b515
Switch the gradient drawing code to use bearing angles
https://bugs.webkit.org/show_bug.cgi?id=104616

Patch by Tab Atkins <tabatkins@google.com> on 2012-12-13
Reviewed by Dean Jackson.

Source/WebCore:

Switch the gradient math from polar-coordinate angles to bearing angles.
To make this possible without behavior changes,
switch the m_deprecatedType boolean to an m_gradientType enum,
and fix all usages accordingly.

No new tests, as this is a refactoring and should have no behavior changes. Existing tests suffice.

* css/CSSGradientValue.cpp:
(WebCore::endPointsFromAngle):
This is the only mechanical change. The rest are just fixing the plumbing around the boolean->enum change.

* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::sortStopsIfNeeded):
(WebCore::CSSGradientValue::addStops):
(WebCore::CSSLinearGradientValue::customCssText):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::customCssText):
* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::gradientType):
(WebCore::CSSGradientValue::CSSGradientValue):
(WebCore::CSSLinearGradientValue::create):
(WebCore::CSSLinearGradientValue::CSSLinearGradientValue):
(WebCore::CSSRadialGradientValue::create):
(WebCore::CSSRadialGradientValue::CSSRadialGradientValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseDeprecatedGradient):
(WebCore::CSSParser::parseDeprecatedLinearGradient):
(WebCore::CSSParser::parseDeprecatedRadialGradient):

LayoutTests:

This change alters a few pixels on the linux baseline.
It may or may not trigger similar failures on Windows and Mac - we'll see.

* platform/chromium-linux/fast/gradients/css3-linear-angle-gradients-expected.png:
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/fast/gradients/css3-linear-angle-gradients-expected.png
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSGradientValue.h
Source/WebCore/css/CSSParser.cpp