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) |
36 bool equals(const DisplayItem& other) const final | 37 bool equals(const DisplayItem& other) const final |
37 { | 38 { |
38 return DisplayItem::equals(other) | 39 return DisplayItem::equals(other) |
39 // TODO(wangxianzhu): compare m_imageFilter and m_webFilterOperation
s. | 40 // TODO(wangxianzhu): compare m_imageFilter and m_webFilterOperation
s. |
40 && m_bounds == static_cast<const BeginFilterDisplayItem&>(other).m_b
ounds | 41 && m_bounds == static_cast<const BeginFilterDisplayItem&>(other).m_b
ounds |
41 && m_origin == static_cast<const BeginFilterDisplayItem&>(other).m_o
rigin; | 42 && m_origin == static_cast<const BeginFilterDisplayItem&>(other).m_o
rigin; |
42 } | 43 } |
| 44 #endif |
43 | 45 |
44 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. | 46 // FIXME: m_imageFilter should be replaced with m_webFilterOperations when c
opying data to the compositor. |
45 sk_sp<SkImageFilter> m_imageFilter; | 47 sk_sp<SkImageFilter> m_imageFilter; |
46 CompositorFilterOperations m_compositorFilterOperations; | 48 CompositorFilterOperations m_compositorFilterOperations; |
47 const FloatRect m_bounds; | 49 const FloatRect m_bounds; |
48 const FloatPoint m_origin; | 50 const FloatPoint m_origin; |
49 }; | 51 }; |
50 | 52 |
51 class PLATFORM_EXPORT EndFilterDisplayItem final : public PairedEndDisplayItem { | 53 class PLATFORM_EXPORT EndFilterDisplayItem final : public PairedEndDisplayItem { |
52 public: | 54 public: |
53 EndFilterDisplayItem(const DisplayItemClient& client) | 55 EndFilterDisplayItem(const DisplayItemClient& client) |
54 : PairedEndDisplayItem(client, kEndFilter, sizeof(*this)) { } | 56 : PairedEndDisplayItem(client, kEndFilter, sizeof(*this)) { } |
55 | 57 |
56 void replay(GraphicsContext&) const override; | 58 void replay(GraphicsContext&) const override; |
57 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 59 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
58 | 60 |
59 private: | 61 private: |
60 #if ENABLE(ASSERT) | 62 #if ENABLE(ASSERT) |
61 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginFilter; } | 63 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginFilter; } |
62 #endif | 64 #endif |
63 }; | 65 }; |
64 | 66 |
65 } // namespace blink | 67 } // namespace blink |
66 | 68 |
67 #endif // FilterDisplayItem_h | 69 #endif // FilterDisplayItem_h |
OLD | NEW |