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 WTF_MAKE_FAST_ALLOCATED(BeginTransform3DDisplayItem); | |
17 public: | 16 public: |
18 static PassOwnPtr<BeginTransform3DDisplayItem> create(const DisplayItemClien
tWrapper& client, DisplayItem::Type type, const TransformationMatrix& transform) | 17 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type typ
e, const TransformationMatrix& transform) |
19 { | |
20 return adoptPtr(new BeginTransform3DDisplayItem(client, type, transform)
); | |
21 } | |
22 | |
23 BeginTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayI
tem::Type type, const TransformationMatrix& transform) | |
24 : PairedBeginDisplayItem(client, type) | 18 : PairedBeginDisplayItem(client, type) |
25 , m_transform(transform) | 19 , m_transform(transform) |
26 { | 20 { |
27 ASSERT(DisplayItem::isTransform3DType(type)); | 21 ASSERT(DisplayItem::isTransform3DType(type)); |
28 } | 22 } |
29 | 23 |
30 virtual void replay(GraphicsContext&) override; | 24 virtual void replay(GraphicsContext&) override; |
31 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 25 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
32 | 26 |
33 const TransformationMatrix& transform() const { return m_transform; } | 27 const TransformationMatrix& transform() const { return m_transform; } |
34 | 28 |
35 private: | 29 private: |
36 const TransformationMatrix m_transform; | 30 const TransformationMatrix m_transform; |
37 }; | 31 }; |
38 | 32 |
39 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { | 33 class PLATFORM_EXPORT EndTransform3DDisplayItem : public PairedEndDisplayItem { |
40 WTF_MAKE_FAST_ALLOCATED(EndTransform3DDisplayItem); | |
41 public: | 34 public: |
42 static PassOwnPtr<EndTransform3DDisplayItem> create(const DisplayItemClientW
rapper& client, DisplayItem::Type type) | 35 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, Type type) |
43 { | |
44 return adoptPtr(new EndTransform3DDisplayItem(client, type)); | |
45 } | |
46 | |
47 EndTransform3DDisplayItem(const DisplayItemClientWrapper& client, DisplayIte
m::Type type) | |
48 : PairedEndDisplayItem(client, type) | 36 : PairedEndDisplayItem(client, type) |
49 { | 37 { |
50 ASSERT(DisplayItem::isEndTransform3DType(type)); | 38 ASSERT(DisplayItem::isEndTransform3DType(type)); |
51 } | 39 } |
52 | 40 |
53 virtual void replay(GraphicsContext&) override; | 41 virtual void replay(GraphicsContext&) override; |
54 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 42 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
55 | 43 |
56 private: | 44 private: |
57 #if ENABLE(ASSERT) | 45 #if ENABLE(ASSERT) |
58 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final | 46 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final |
59 { | 47 { |
60 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty
pe(); | 48 return DisplayItem::transform3DTypeToEndTransform3DType(otherType) == ty
pe(); |
61 } | 49 } |
62 #endif | 50 #endif |
63 }; | 51 }; |
64 | 52 |
65 } // namespace blink | 53 } // namespace blink |
66 | 54 |
67 #endif // Transform3DDisplayItem_h | 55 #endif // Transform3DDisplayItem_h |
OLD | NEW |