Index: third_party/WebKit/Source/core/style/FilterOperation.cpp |
diff --git a/third_party/WebKit/Source/core/style/FilterOperation.cpp b/third_party/WebKit/Source/core/style/FilterOperation.cpp |
index a12dcb7285cb26d06cede13a01a442d088fd43e6..6308d7038524d54066c603caa56efdd43355da27 100644 |
--- a/third_party/WebKit/Source/core/style/FilterOperation.cpp |
+++ b/third_party/WebKit/Source/core/style/FilterOperation.cpp |
@@ -27,24 +27,13 @@ |
#include "platform/LengthFunctions.h" |
#include "platform/animation/AnimationUtilities.h" |
+#include "platform/graphics/filters/FEDropShadow.h" |
#include "platform/graphics/filters/FEGaussianBlur.h" |
#include "platform/graphics/filters/Filter.h" |
#include "platform/graphics/filters/FilterEffect.h" |
-#include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
namespace blink { |
-static inline FloatSize outsetSizeForBlur(float stdDeviation) { |
- IntSize kernelSize = FEGaussianBlur::calculateUnscaledKernelSize( |
- FloatPoint(stdDeviation, stdDeviation)); |
- FloatSize outset; |
- // We take the half kernel size and multiply it with three, because we run box |
- // blur three times. |
- outset.setWidth(3.0f * kernelSize.width() * 0.5f); |
- outset.setHeight(3.0f * kernelSize.height() * 0.5f); |
- return outset; |
-} |
- |
FilterOperation* FilterOperation::blend(const FilterOperation* from, |
const FilterOperation* to, |
double progress) { |
@@ -146,13 +135,8 @@ FilterOperation* BasicComponentTransferFilterOperation::blend( |
} |
FloatRect BlurFilterOperation::mapRect(const FloatRect& rect) const { |
- // Matches FEGaussianBlur::mapRect. |
float stdDeviation = floatValueForLength(m_stdDeviation, 0); |
- FloatSize outsetSize = outsetSizeForBlur(stdDeviation); |
- FloatRect mappedRect = rect; |
- mappedRect.inflateX(outsetSize.width()); |
- mappedRect.inflateY(outsetSize.height()); |
- return mappedRect; |
+ return FEGaussianBlur::mapEffect(FloatSize(stdDeviation, stdDeviation), rect); |
} |
FilterOperation* BlurFilterOperation::blend(const FilterOperation* from, |
@@ -168,13 +152,9 @@ FilterOperation* BlurFilterOperation::blend(const FilterOperation* from, |
} |
FloatRect DropShadowFilterOperation::mapRect(const FloatRect& rect) const { |
- FloatSize outsetSize = outsetSizeForBlur(m_stdDeviation); |
- FloatRect mappedRect = rect; |
- mappedRect.inflateX(outsetSize.width()); |
- mappedRect.inflateY(outsetSize.height()); |
- mappedRect.moveBy(m_location); |
- mappedRect.unite(rect); |
- return mappedRect; |
+ float stdDeviation = m_stdDeviation; |
+ return FEDropShadow::mapEffect(FloatSize(stdDeviation, stdDeviation), |
+ FloatPoint(m_location), rect); |
} |
FilterOperation* DropShadowFilterOperation::blend(const FilterOperation* from, |