| 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) |
| 39 bool equals(const DisplayItem& other) const final | 40 bool equals(const DisplayItem& other) const final |
| 40 { | 41 { |
| 41 return DisplayItem::equals(other) | 42 return DisplayItem::equals(other) |
| 42 && m_transform == static_cast<const BeginTransform3DDisplayItem&>(ot
her).m_transform | 43 && m_transform == static_cast<const BeginTransform3DDisplayItem&>(ot
her).m_transform |
| 43 && m_transformOrigin == static_cast<const BeginTransform3DDisplayIte
m&>(other).m_transformOrigin; | 44 && m_transformOrigin == static_cast<const BeginTransform3DDisplayIte
m&>(other).m_transformOrigin; |
| 44 } | 45 } |
| 46 #endif |
| 45 | 47 |
| 46 const TransformationMatrix m_transform; | 48 const TransformationMatrix m_transform; |
| 47 const FloatPoint3D m_transformOrigin; | 49 const FloatPoint3D m_transformOrigin; |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 class PLATFORM_EXPORT EndTransform3DDisplayItem final : public PairedEndDisplayI
tem { | 52 class PLATFORM_EXPORT EndTransform3DDisplayItem final : public PairedEndDisplayI
tem { |
| 51 public: | 53 public: |
| 52 EndTransform3DDisplayItem(const DisplayItemClient& client, Type type) | 54 EndTransform3DDisplayItem(const DisplayItemClient& client, Type type) |
| 53 : PairedEndDisplayItem(client, type, sizeof(*this)) | 55 : PairedEndDisplayItem(client, type, sizeof(*this)) |
| 54 { | 56 { |
| 55 ASSERT(DisplayItem::isEndTransform3DType(type)); | 57 ASSERT(DisplayItem::isEndTransform3DType(type)); |
| 56 } | 58 } |
| 57 | 59 |
| 58 void replay(GraphicsContext&) const override; | 60 void replay(GraphicsContext&) const override; |
| 59 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 61 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 60 | 62 |
| 61 private: | 63 private: |
| 62 #if ENABLE(ASSERT) | 64 #if ENABLE(ASSERT) |
| 63 bool isEndAndPairedWith(DisplayItem::Type otherType) const final | 65 bool isEndAndPairedWith(DisplayItem::Type otherType) const final |
| 64 { | 66 { |
| 65 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ge
tType(); | 67 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ge
tType(); |
| 66 } | 68 } |
| 67 #endif | 69 #endif |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace blink | 72 } // namespace blink |
| 71 | 73 |
| 72 #endif // Transform3DDisplayItem_h | 74 #endif // Transform3DDisplayItem_h |
| OLD | NEW |