| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/filters/FEBoxReflect.h" | 5 #include "platform/graphics/filters/FEBoxReflect.h" |
| 6 | 6 |
| 7 #include "platform/geometry/FloatRect.h" | 7 #include "platform/geometry/FloatRect.h" |
| 8 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" | 8 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 FEBoxReflect::FEBoxReflect(Filter* filter, const BoxReflection& reflection) | 13 FEBoxReflect::FEBoxReflect(Filter* filter, const BoxReflection& reflection) |
| 14 : FilterEffect(filter) | 14 : FilterEffect(filter) |
| 15 , m_reflection(reflection) | 15 , m_reflection(reflection) |
| 16 { | 16 { |
| 17 } | 17 } |
| 18 | 18 |
| 19 FEBoxReflect::~FEBoxReflect() | 19 FEBoxReflect::~FEBoxReflect() |
| 20 { | 20 { |
| 21 } | 21 } |
| 22 | 22 |
| 23 FloatRect FEBoxReflect::mapRect(const FloatRect& rect, bool forward) const | 23 FloatRect FEBoxReflect::mapEffect(const FloatRect& rect) const |
| 24 { | 24 { |
| 25 // Reflection about any line is self-inverse, so this for both forward and | 25 // Reflection about any line is self-inverse, so this for both forward and |
| 26 // reverse mapping. | 26 // reverse mapping. |
| 27 return m_reflection.mapRect(rect); | 27 return m_reflection.mapRect(rect); |
| 28 } | 28 } |
| 29 | 29 |
| 30 TextStream& FEBoxReflect::externalRepresentation(TextStream& ts, int indent) con
st | 30 TextStream& FEBoxReflect::externalRepresentation(TextStream& ts, int indent) con
st |
| 31 { | 31 { |
| 32 // Only called for SVG layout tree printing. | 32 // Only called for SVG layout tree printing. |
| 33 ASSERT_NOT_REACHED(); | 33 ASSERT_NOT_REACHED(); |
| 34 return ts; | 34 return ts; |
| 35 } | 35 } |
| 36 | 36 |
| 37 sk_sp<SkImageFilter> FEBoxReflect::createImageFilter() | 37 sk_sp<SkImageFilter> FEBoxReflect::createImageFilter() |
| 38 { | 38 { |
| 39 return SkiaImageFilterBuilder::buildBoxReflectFilter(m_reflection, SkiaImage
FilterBuilder::build(inputEffect(0), operatingColorSpace())); | 39 return SkiaImageFilterBuilder::buildBoxReflectFilter(m_reflection, SkiaImage
FilterBuilder::build(inputEffect(0), operatingColorSpace())); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace blink | 42 } // namespace blink |
| OLD | NEW |