Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h b/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h |
| index f7a2668cc3c5c6ca15bce8ed64c8e48e1dd2f21e..157b9373b30f618bae7fa8813feb21a07c569693 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h |
| +++ b/third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h |
| @@ -29,6 +29,7 @@ |
| #include "platform/Length.h" |
| #include "platform/PlatformExport.h" |
| #include "platform/graphics/Color.h" |
| +#include "platform/graphics/GraphicsTypes.h" |
| #include "platform/graphics/filters/Filter.h" |
| #include "platform/heap/Handle.h" |
| #include "wtf/Noncopyable.h" |
| @@ -56,6 +57,7 @@ public: |
| CONTRAST, |
| BLUR, |
| DROP_SHADOW, |
| + BOX_REFLECT, |
|
pdr.
2016/03/29 18:36:55
Can you add a very short comment describing this a
Stephen White
2016/03/30 14:41:35
+1
jbroman
2016/04/05 15:51:56
I'd think that specifying something more similar t
|
| NONE |
| }; |
| @@ -74,6 +76,7 @@ public: |
| case DROP_SHADOW: |
| return true; |
| case REFERENCE: |
| + case BOX_REFLECT: |
| return false; |
| case NONE: |
| break; |
| @@ -314,7 +317,35 @@ private: |
| DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW); |
| -} // namespace blink |
| +class PLATFORM_EXPORT BoxReflectFilterOperation : public FilterOperation { |
| +public: |
| + static PassRefPtrWillBeRawPtr<BoxReflectFilterOperation> create(ReflectionDirection direction, float offset) |
| + { |
| + return adoptRefWillBeNoop(new BoxReflectFilterOperation(direction, offset)); |
| + } |
| + |
| + ReflectionDirection direction() const { return m_direction; } |
| + float offset() const { return m_offset; } |
| + bool affectsOpacity() const override { return true; } |
| + bool movesPixels() const override { return true; } |
| + |
| +private: |
| + PassRefPtrWillBeRawPtr<FilterOperation> blend(const FilterOperation* from, double progress) const override; |
| + bool operator==(const FilterOperation&) const override; |
| + |
| + BoxReflectFilterOperation(ReflectionDirection direction, float offset) |
| + : FilterOperation(BOX_REFLECT) |
| + , m_direction(direction) |
| + , m_offset(offset) |
| + { |
| + } |
| + |
| + ReflectionDirection m_direction; |
| + float m_offset; |
| +}; |
| +DEFINE_FILTER_OPERATION_TYPE_CASTS(BoxReflectFilterOperation, BOX_REFLECT); |
| + |
| +} // namespace blink |
| #endif // FilterOperation_h |