| 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/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public DisplayItem { | 14 class PLATFORM_EXPORT BeginTransform3DDisplayItem : public PairedBeginDisplayIte
m { |
| 15 WTF_MAKE_FAST_ALLOCATED; | 15 WTF_MAKE_FAST_ALLOCATED; |
| 16 public: | 16 public: |
| 17 static PassOwnPtr<BeginTransform3DDisplayItem> create(DisplayItemClient clie
nt, const TransformationMatrix& transform) | 17 static PassOwnPtr<BeginTransform3DDisplayItem> create(DisplayItemClient clie
nt, const TransformationMatrix& transform) |
| 18 { | 18 { |
| 19 return adoptPtr(new BeginTransform3DDisplayItem(client, transform)); | 19 return adoptPtr(new BeginTransform3DDisplayItem(client, transform)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 BeginTransform3DDisplayItem(DisplayItemClient client, const TransformationMa
trix& transform) | 22 BeginTransform3DDisplayItem(DisplayItemClient client, const TransformationMa
trix& transform) |
| 23 : DisplayItem(client, BeginTransform) | 23 : PairedBeginDisplayItem(client, BeginTransform) |
| 24 , m_transform(transform) { } | 24 , m_transform(transform) { } |
| 25 | 25 |
| 26 virtual void replay(GraphicsContext*) override; | 26 virtual void replay(GraphicsContext*) override; |
| 27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 const TransformationMatrix m_transform; | 30 const TransformationMatrix m_transform; |
| 31 FloatPoint3D m_transformOrigin; | 31 FloatPoint3D m_transformOrigin; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 class PLATFORM_EXPORT EndTransform3DDisplayItem : public DisplayItem { | 34 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { |
| 35 WTF_MAKE_FAST_ALLOCATED; | 35 WTF_MAKE_FAST_ALLOCATED; |
| 36 public: | 36 public: |
| 37 static PassOwnPtr<EndTransform3DDisplayItem> create(DisplayItemClient client
) | 37 static PassOwnPtr<EndTransform3DDisplayItem> create(DisplayItemClient client
) |
| 38 { | 38 { |
| 39 return adoptPtr(new EndTransform3DDisplayItem(client)); | 39 return adoptPtr(new EndTransform3DDisplayItem(client)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 EndTransform3DDisplayItem(DisplayItemClient client) | 42 EndTransform3DDisplayItem(DisplayItemClient client) |
| 43 : DisplayItem(client, EndTransform) { } | 43 : PairedEndDisplayItem(client, EndTransform) { } |
| 44 | 44 |
| 45 virtual void replay(GraphicsContext*) override; | 45 virtual void replay(GraphicsContext*) override; |
| 46 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 46 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 47 |
| 48 private: |
| 49 #if ENABLE(ASSERT) |
| 50 // FIXME: Distinguish BeginTransformDisplayItem and BeginTransform3DDisplayI
tem. |
| 51 virtual bool isEndAndPairedWith(const DisplayItem& other) const override fin
al { return other.type() == BeginTransform; } |
| 52 #endif |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 } // namespace blink | 55 } // namespace blink |
| 50 | 56 |
| 51 #endif // Transform3DDisplayItem_h | 57 #endif // Transform3DDisplayItem_h |
| OLD | NEW |