Index: third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp |
index 938fd18406ba0b756671ef57f36f06ad8cfe58f1..84148574ade7a50122cf122acc82530a371be056 100644 |
--- a/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp |
@@ -54,23 +54,23 @@ FEDropShadow* FEDropShadow::create(Filter* filter, |
shadowOpacity); |
} |
+FloatRect FEDropShadow::mapEffect(const FloatSize& stdDeviation, |
+ const FloatPoint& offset, |
+ const FloatRect& rect) { |
+ FloatRect offsetRect = rect; |
+ offsetRect.moveBy(offset); |
+ FloatRect blurredRect = FEGaussianBlur::mapEffect(stdDeviation, offsetRect); |
+ return unionRect(blurredRect, rect); |
+} |
+ |
FloatRect FEDropShadow::mapEffect(const FloatRect& rect) const { |
const Filter* filter = this->getFilter(); |
DCHECK(filter); |
- |
- FloatRect offsetRect = rect; |
- offsetRect.move(filter->applyHorizontalScale(m_dx), |
- filter->applyVerticalScale(m_dy)); |
- |
- IntSize kernelSize = |
- FEGaussianBlur::calculateKernelSize(filter, FloatPoint(m_stdX, m_stdY)); |
- |
- // We take the half kernel size and multiply it by three, because we run box |
- // blur three times. |
- FloatRect result = unionRect(rect, offsetRect); |
- result.inflateX(3.0f * kernelSize.width() * 0.5f); |
- result.inflateY(3.0f * kernelSize.height() * 0.5f); |
- return result; |
+ FloatPoint offset(filter->applyHorizontalScale(m_dx), |
+ filter->applyVerticalScale(m_dy)); |
+ FloatSize stdError(filter->applyHorizontalScale(m_stdX), |
+ filter->applyVerticalScale(m_stdY)); |
+ return mapEffect(stdError, offset, rect); |
} |
sk_sp<SkImageFilter> FEDropShadow::createImageFilter() { |