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 TransformDisplayItem_h | 5 #ifndef TransformDisplayItem_h |
6 #define TransformDisplayItem_h | 6 #define TransformDisplayItem_h |
7 | 7 |
8 #include "platform/graphics/paint/DisplayItem.h" | 8 #include "platform/graphics/paint/DisplayItem.h" |
9 #include "platform/transforms/AffineTransform.h" | 9 #include "platform/transforms/AffineTransform.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class PLATFORM_EXPORT BeginTransformDisplayItem final : public PairedBeginDispla
yItem { | 13 class PLATFORM_EXPORT BeginTransformDisplayItem final : public PairedBeginDispla
yItem { |
14 public: | 14 public: |
15 BeginTransformDisplayItem(const DisplayItemClient& client, const AffineTrans
form& transform) | 15 BeginTransformDisplayItem(const DisplayItemClient& client, const AffineTrans
form& transform) |
16 : PairedBeginDisplayItem(client, kBeginTransform, sizeof(*this)) | 16 : PairedBeginDisplayItem(client, kBeginTransform, sizeof(*this)) |
17 , m_transform(transform) { } | 17 , m_transform(transform) { } |
18 | 18 |
19 void replay(GraphicsContext&) const override; | 19 void replay(GraphicsContext&) const override; |
20 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 20 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
21 | 21 |
22 const AffineTransform& transform() const { return m_transform; } | 22 const AffineTransform& transform() const { return m_transform; } |
23 | 23 |
24 private: | 24 private: |
25 #ifndef NDEBUG | 25 #ifndef NDEBUG |
26 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; | 26 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; |
27 #endif | 27 #endif |
| 28 #if ENABLE(ASSERT) |
28 bool equals(const DisplayItem& other) const final | 29 bool equals(const DisplayItem& other) const final |
29 { | 30 { |
30 return DisplayItem::equals(other) | 31 return DisplayItem::equals(other) |
31 && m_transform == static_cast<const BeginTransformDisplayItem&>(othe
r).m_transform; | 32 && m_transform == static_cast<const BeginTransformDisplayItem&>(othe
r).m_transform; |
32 } | 33 } |
| 34 #endif |
33 | 35 |
34 const AffineTransform m_transform; | 36 const AffineTransform m_transform; |
35 }; | 37 }; |
36 | 38 |
37 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { | 39 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { |
38 public: | 40 public: |
39 EndTransformDisplayItem(const DisplayItemClient& client) | 41 EndTransformDisplayItem(const DisplayItemClient& client) |
40 : PairedEndDisplayItem(client, kEndTransform, sizeof(*this)) { } | 42 : PairedEndDisplayItem(client, kEndTransform, sizeof(*this)) { } |
41 | 43 |
42 void replay(GraphicsContext&) const override; | 44 void replay(GraphicsContext&) const override; |
43 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 45 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
44 | 46 |
45 private: | 47 private: |
46 #if ENABLE(ASSERT) | 48 #if ENABLE(ASSERT) |
47 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginTransform; } | 49 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == kBeginTransform; } |
48 #endif | 50 #endif |
49 }; | 51 }; |
50 | 52 |
51 } // namespace blink | 53 } // namespace blink |
52 | 54 |
53 #endif // TransformDisplayItem_h | 55 #endif // TransformDisplayItem_h |
OLD | NEW |