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 CompositingDisplayItem_h | 5 #ifndef CompositingDisplayItem_h |
6 #define CompositingDisplayItem_h | 6 #define CompositingDisplayItem_h |
7 | 7 |
8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
9 #include "platform/graphics/GraphicsTypes.h" | 9 #include "platform/graphics/GraphicsTypes.h" |
10 #include "platform/graphics/paint/DisplayItem.h" | 10 #include "platform/graphics/paint/DisplayItem.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 m_bounds = FloatRect(*bounds); | 28 m_bounds = FloatRect(*bounds); |
29 } | 29 } |
30 | 30 |
31 void replay(GraphicsContext&) const override; | 31 void replay(GraphicsContext&) const override; |
32 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 32 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
33 | 33 |
34 private: | 34 private: |
35 #ifndef NDEBUG | 35 #ifndef NDEBUG |
36 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; | 36 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override; |
37 #endif | 37 #endif |
| 38 #if ENABLE(ASSERT) |
38 bool equals(const DisplayItem& other) const final | 39 bool equals(const DisplayItem& other) const final |
39 { | 40 { |
40 return DisplayItem::equals(other) | 41 return DisplayItem::equals(other) |
41 && m_xferMode == static_cast<const BeginCompositingDisplayItem&>(oth
er).m_xferMode | 42 && m_xferMode == static_cast<const BeginCompositingDisplayItem&>(oth
er).m_xferMode |
42 && m_opacity == static_cast<const BeginCompositingDisplayItem&>(othe
r).m_opacity | 43 && m_opacity == static_cast<const BeginCompositingDisplayItem&>(othe
r).m_opacity |
43 && m_hasBounds == static_cast<const BeginCompositingDisplayItem&>(ot
her).m_hasBounds | 44 && m_hasBounds == static_cast<const BeginCompositingDisplayItem&>(ot
her).m_hasBounds |
44 && m_bounds == static_cast<const BeginCompositingDisplayItem&>(other
).m_bounds | 45 && m_bounds == static_cast<const BeginCompositingDisplayItem&>(other
).m_bounds |
45 && m_colorFilter == static_cast<const BeginCompositingDisplayItem&>(
other).m_colorFilter; | 46 && m_colorFilter == static_cast<const BeginCompositingDisplayItem&>(
other).m_colorFilter; |
46 } | 47 } |
| 48 #endif |
47 | 49 |
48 const SkXfermode::Mode m_xferMode; | 50 const SkXfermode::Mode m_xferMode; |
49 const float m_opacity; | 51 const float m_opacity; |
50 bool m_hasBounds; | 52 bool m_hasBounds; |
51 FloatRect m_bounds; | 53 FloatRect m_bounds; |
52 ColorFilter m_colorFilter; | 54 ColorFilter m_colorFilter; |
53 }; | 55 }; |
54 | 56 |
55 class PLATFORM_EXPORT EndCompositingDisplayItem final : public PairedEndDisplayI
tem { | 57 class PLATFORM_EXPORT EndCompositingDisplayItem final : public PairedEndDisplayI
tem { |
56 public: | 58 public: |
57 EndCompositingDisplayItem(const DisplayItemClient& client) | 59 EndCompositingDisplayItem(const DisplayItemClient& client) |
58 : PairedEndDisplayItem(client, kEndCompositing, sizeof(*this)) { } | 60 : PairedEndDisplayItem(client, kEndCompositing, sizeof(*this)) { } |
59 | 61 |
60 void replay(GraphicsContext&) const override; | 62 void replay(GraphicsContext&) const override; |
61 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 63 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
62 | 64 |
63 private: | 65 private: |
64 #if ENABLE(ASSERT) | 66 #if ENABLE(ASSERT) |
65 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginCompositing; } | 67 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginCompositing; } |
66 #endif | 68 #endif |
67 }; | 69 }; |
68 | 70 |
69 } // namespace blink | 71 } // namespace blink |
70 | 72 |
71 #endif // CompositingDisplayItem_h | 73 #endif // CompositingDisplayItem_h |
OLD | NEW |