| Index: third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp
|
| index bd73ca8750cef603ad66aeb7ed6aee7508d4341b..456932579b7067c07b64c7e5cb0b6e50e73583c9 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp
|
| @@ -10,15 +10,9 @@
|
|
|
| namespace blink {
|
|
|
| -FEBoxReflect* FEBoxReflect::create(Filter* filter, ReflectionDirection direction, float offset)
|
| -{
|
| - return new FEBoxReflect(filter, direction, offset);
|
| -}
|
| -
|
| -FEBoxReflect::FEBoxReflect(Filter* filter, ReflectionDirection direction, float offset)
|
| +FEBoxReflect::FEBoxReflect(Filter* filter, const BoxReflection& reflection)
|
| : FilterEffect(filter)
|
| - , m_reflectionDirection(direction)
|
| - , m_offset(offset)
|
| + , m_reflection(reflection)
|
| {
|
| }
|
|
|
| @@ -28,17 +22,9 @@ FEBoxReflect::~FEBoxReflect()
|
|
|
| FloatRect FEBoxReflect::mapRect(const FloatRect& rect, bool forward) const
|
| {
|
| - // Reflection about any line is self-inverse, so this matrix works for both
|
| - // forward and reverse mapping.
|
| - SkMatrix flipMatrix = SkiaImageFilterBuilder().matrixForBoxReflectFilter(
|
| - m_reflectionDirection, m_offset);
|
| -
|
| - SkRect reflection(rect);
|
| - flipMatrix.mapRect(&reflection);
|
| -
|
| - FloatRect result = rect;
|
| - result.unite(reflection);
|
| - return result;
|
| + // Reflection about any line is self-inverse, so this for both forward and
|
| + // reverse mapping.
|
| + return m_reflection.mapRect(rect);
|
| }
|
|
|
| TextStream& FEBoxReflect::externalRepresentation(TextStream& ts, int indent) const
|
| @@ -51,7 +37,7 @@ TextStream& FEBoxReflect::externalRepresentation(TextStream& ts, int indent) con
|
| PassRefPtr<SkImageFilter> FEBoxReflect::createImageFilter(SkiaImageFilterBuilder& builder)
|
| {
|
| RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace()));
|
| - return builder.buildBoxReflectFilter(m_reflectionDirection, m_offset, nullptr, input.get());
|
| + return SkiaImageFilterBuilder().buildBoxReflectFilter(m_reflection, input.release());
|
| }
|
|
|
| } // namespace blink
|
|
|