| 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/graphics/paint/DisplayItem.h" | 8 #include "platform/graphics/paint/DisplayItem.h" |
| 9 #include "platform/transforms/TransformationMatrix.h" | 9 #include "platform/transforms/TransformationMatrix.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public PairedBeginDisplayIte
m { | 15 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public PairedBeginDisplayIte
m { |
| 16 public: | 16 public: |
| 17 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type typ
e, const TransformationMatrix& transform) | 17 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type typ
e, const TransformationMatrix& transform) |
| 18 : PairedBeginDisplayItem(client, type) | 18 : PairedBeginDisplayItem(client, type) |
| 19 , m_transform(transform) | 19 , m_transform(transform) |
| 20 { | 20 { |
| 21 ASSERT(DisplayItem::isTransform3DType(type)); | 21 ASSERT(DisplayItem::isTransform3DType(type)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 virtual void replay(GraphicsContext&) override; | 24 void replay(GraphicsContext&) override; |
| 25 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 25 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 26 | 26 |
| 27 const TransformationMatrix& transform() const { return m_transform; } | 27 const TransformationMatrix& transform() const { return m_transform; } |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 const TransformationMatrix m_transform; | 30 const TransformationMatrix m_transform; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { | 33 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { |
| 34 public: | 34 public: |
| 35 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type type) | 35 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 36 : PairedEndDisplayItem(client, type) | 36 : PairedEndDisplayItem(client, type) |
| 37 { | 37 { |
| 38 ASSERT(DisplayItem::isEndTransform3DType(type)); | 38 ASSERT(DisplayItem::isEndTransform3DType(type)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 virtual void replay(GraphicsContext&) override; | 41 void replay(GraphicsContext&) override; |
| 42 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 42 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 #if ENABLE(ASSERT) | 45 #if ENABLE(ASSERT) |
| 46 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final | 46 bool isEndAndPairedWith(DisplayItem::Type otherType) const final |
| 47 { | 47 { |
| 48 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty
pe(); | 48 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty
pe(); |
| 49 } | 49 } |
| 50 #endif | 50 #endif |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace blink | 53 } // namespace blink |
| 54 | 54 |
| 55 #endif // Transform3DDisplayItem_h | 55 #endif // Transform3DDisplayItem_h |
| OLD | NEW |