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 Transform3DDisplayItem_h | 5 #ifndef Transform3DDisplayItem_h |
6 #define Transform3DDisplayItem_h | 6 #define Transform3DDisplayItem_h |
7 | 7 |
8 #include "platform/geometry/FloatPoint3D.h" | 8 #include "platform/geometry/FloatPoint3D.h" |
9 #include "platform/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
10 #include "platform/transforms/TransformationMatrix.h" | 10 #include "platform/transforms/TransformationMatrix.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 void replay(GraphicsContext&) const override; | 29 void replay(GraphicsContext&) const override; |
30 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 30 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
31 | 31 |
32 const TransformationMatrix& transform() const { return m_transform; } | 32 const TransformationMatrix& transform() const { return m_transform; } |
33 const FloatPoint3D& transformOrigin() const { return m_transformOrigin; } | 33 const FloatPoint3D& transformOrigin() const { return m_transformOrigin; } |
34 | 34 |
35 private: | 35 private: |
36 #ifndef NDEBUG | 36 #ifndef NDEBUG |
37 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; | 37 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; |
38 #endif | 38 #endif |
39 #if ENABLE(ASSERT) | |
40 bool equals(const DisplayItem& other) const final | 39 bool equals(const DisplayItem& other) const final |
41 { | 40 { |
42 return DisplayItem::equals(other) | 41 return DisplayItem::equals(other) |
43 && m_transform == static_cast<const BeginTransform3DDisplayItem&>(ot
her).m_transform | 42 && m_transform == static_cast<const BeginTransform3DDisplayItem&>(ot
her).m_transform |
44 && m_transformOrigin == static_cast<const BeginTransform3DDisplayIte
m&>(other).m_transformOrigin; | 43 && m_transformOrigin == static_cast<const BeginTransform3DDisplayIte
m&>(other).m_transformOrigin; |
45 } | 44 } |
46 #endif | |
47 | 45 |
48 const TransformationMatrix m_transform; | 46 const TransformationMatrix m_transform; |
49 const FloatPoint3D m_transformOrigin; | 47 const FloatPoint3D m_transformOrigin; |
50 }; | 48 }; |
51 | 49 |
52 class PLATFORM_EXPORT EndTransform3DDisplayItem final : public PairedEndDisplayI
tem { | 50 class PLATFORM_EXPORT EndTransform3DDisplayItem final : public PairedEndDisplayI
tem { |
53 public: | 51 public: |
54 EndTransform3DDisplayItem(const DisplayItemClient& client, Type type) | 52 EndTransform3DDisplayItem(const DisplayItemClient& client, Type type) |
55 : PairedEndDisplayItem(client, type, sizeof(*this)) | 53 : PairedEndDisplayItem(client, type, sizeof(*this)) |
56 { | 54 { |
57 ASSERT(DisplayItem::isEndTransform3DType(type)); | 55 ASSERT(DisplayItem::isEndTransform3DType(type)); |
58 } | 56 } |
59 | 57 |
60 void replay(GraphicsContext&) const override; | 58 void replay(GraphicsContext&) const override; |
61 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 59 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
62 | 60 |
63 private: | 61 private: |
64 #if ENABLE(ASSERT) | 62 #if ENABLE(ASSERT) |
65 bool isEndAndPairedWith(DisplayItem::Type otherType) const final | 63 bool isEndAndPairedWith(DisplayItem::Type otherType) const final |
66 { | 64 { |
67 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ge
tType(); | 65 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ge
tType(); |
68 } | 66 } |
69 #endif | 67 #endif |
70 }; | 68 }; |
71 | 69 |
72 } // namespace blink | 70 } // namespace blink |
73 | 71 |
74 #endif // Transform3DDisplayItem_h | 72 #endif // Transform3DDisplayItem_h |
OLD | NEW |