Convert ShadowData and DropShadowFilterOperation to use IntPoint
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 17:05:11 +0000 (17:05 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 17:05:11 +0000 (17:05 +0000)
commit783eba38ab48ddaa58074ff8b600d1b5cb816d51
treec0dae90378dcdf8d1626a98070b3c1d1d6070c9f
parent2782aa75ab6fbcccd0dfc0cdf4226499f58a12c3
Convert ShadowData and DropShadowFilterOperation to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=84098

Reviewed by Eric Seidel.

Shadows do not flow with the page, so sub-pixel layout doesn't actually offer any benefit that
couldn't have been attained before that conversion. With that in mind, this patch reverts
drop shadow offsets to integers, but also cleans up the code by switching the x/y location pair
to be an IntPoint.

No new tests. No change in behavior.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::valueForFilter):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
* css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty):
* page/animation/AnimationBase.cpp:
(WebCore::blendFunc):
(WebCore::shadowForBlending):
* platform/animation/AnimationUtilities.h:
(WebCore::blend): New blend function that operates on IntPoints.
(WebCore):
* platform/chromium/support/WebFilterOperations.cpp:
(WebKit::WebDropShadowFilterOperation):
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::DropShadowFilterOperation::blend):
* platform/graphics/filters/FilterOperation.h:
(WebCore::DropShadowFilterOperation::clone):
(WebCore::DropShadowFilterOperation::x):
(WebCore::DropShadowFilterOperation::y):
(WebCore::DropShadowFilterOperation::location): Preserved the comment about lengths.
(WebCore::DropShadowFilterOperation::operator==):
(WebCore::DropShadowFilterOperation::DropShadowFilterOperation):
(DropShadowFilterOperation):
* rendering/RenderBoxModelObject.cpp:
(WebCore::areaCastingShadowInHole): Reverted to integers since this operates on the IntRect from
a RoundedRect.
(WebCore::RenderBoxModelObject::paintBoxShadow): Reduced the complexity and unnecessary conversion
between LayoutUnits and integers by using all integers after we calculate the pixel-snapped
RoundedRect that we use for painting.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowExtent):
(WebCore::RenderStyle::getShadowHorizontalExtent):
(WebCore::RenderStyle::getShadowVerticalExtent):
* rendering/style/ShadowData.cpp:
(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::operator==):
(WebCore::calculateShadowExtent):
(WebCore::ShadowData::adjustRectForShadow):
* rendering/style/ShadowData.h:
(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::x):
(WebCore::ShadowData::y):
(WebCore::ShadowData::location):
(ShadowData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/platform/animation/AnimationUtilities.h
Source/WebCore/platform/chromium/support/WebFilterOperation.cpp
Source/WebCore/platform/graphics/filters/FilterOperation.cpp
Source/WebCore/platform/graphics/filters/FilterOperation.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/ShadowData.cpp
Source/WebCore/rendering/style/ShadowData.h