| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef FilterDisplayItem_h | 5 #ifndef FilterDisplayItem_h |
| 6 #define FilterDisplayItem_h | 6 #define FilterDisplayItem_h |
| 7 | 7 |
| 8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
| 9 #include "platform/graphics/CompositorFilterOperations.h" | 9 #include "platform/graphics/CompositorFilterOperations.h" |
| 10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 , m_origin(origin) { } | 26 , m_origin(origin) { } |
| 27 | 27 |
| 28 void replay(GraphicsContext&) const override; | 28 void replay(GraphicsContext&) const override; |
| 29 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 29 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 30 bool drawsContent() const override; | 30 bool drawsContent() const override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 #ifndef NDEBUG | 33 #ifndef NDEBUG |
| 34 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 34 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
| 35 #endif | 35 #endif |
| 36 #if ENABLE(ASSERT) | |
| 37 bool equals(const DisplayItem& other) const final | 36 bool equals(const DisplayItem& other) const final |
| 38 { | 37 { |
| 39 return DisplayItem::equals(other) | 38 return DisplayItem::equals(other) |
| 40 // TODO(wangxianzhu): compare m_imageFilter and m_webFilterOperation
s. | 39 // TODO(wangxianzhu): compare m_imageFilter and m_webFilterOperation
s. |
| 41 && m_bounds == static_cast<const BeginFilterDisplayItem&>(other).m_b
ounds | 40 && m_bounds == static_cast<const BeginFilterDisplayItem&>(other).m_b
ounds |
| 42 && m_origin == static_cast<const BeginFilterDisplayItem&>(other).m_o
rigin; | 41 && m_origin == static_cast<const BeginFilterDisplayItem&>(other).m_o
rigin; |
| 43 } | 42 } |
| 44 #endif | |
| 45 | 43 |
| 46 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. | 44 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. |
| 47 sk_sp<SkImageFilter> m_imageFilter; | 45 sk_sp<SkImageFilter> m_imageFilter; |
| 48 CompositorFilterOperations m_compositorFilterOperations; | 46 CompositorFilterOperations m_compositorFilterOperations; |
| 49 const FloatRect m_bounds; | 47 const FloatRect m_bounds; |
| 50 const FloatPoint m_origin; | 48 const FloatPoint m_origin; |
| 51 }; | 49 }; |
| 52 | 50 |
| 53 class PLATFORM_EXPORT EndFilterDisplayItem final : public PairedEndDisplayItem { | 51 class PLATFORM_EXPORT EndFilterDisplayItem final : public PairedEndDisplayItem { |
| 54 public: | 52 public: |
| 55 EndFilterDisplayItem(const DisplayItemClient& client) | 53 EndFilterDisplayItem(const DisplayItemClient& client) |
| 56 : PairedEndDisplayItem(client, kEndFilter, sizeof(*this)) { } | 54 : PairedEndDisplayItem(client, kEndFilter, sizeof(*this)) { } |
| 57 | 55 |
| 58 void replay(GraphicsContext&) const override; | 56 void replay(GraphicsContext&) const override; |
| 59 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 57 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 60 | 58 |
| 61 private: | 59 private: |
| 62 #if ENABLE(ASSERT) | 60 #if ENABLE(ASSERT) |
| 63 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginFilter; } | 61 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginFilter; } |
| 64 #endif | 62 #endif |
| 65 }; | 63 }; |
| 66 | 64 |
| 67 } // namespace blink | 65 } // namespace blink |
| 68 | 66 |
| 69 #endif // FilterDisplayItem_h | 67 #endif // FilterDisplayItem_h |
| OLD | NEW |