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 TransformDisplayItem_h | 5 #ifndef TransformDisplayItem_h |
6 #define TransformDisplayItem_h | 6 #define TransformDisplayItem_h |
7 | 7 |
8 #include "platform/graphics/paint/DisplayItem.h" | 8 #include "platform/graphics/paint/DisplayItem.h" |
9 #include "platform/transforms/AffineTransform.h" | 9 #include "platform/transforms/AffineTransform.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 BeginTransformDisplayItem : public PairedBeginDisplayItem
{ | 14 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem
{ |
15 WTF_MAKE_FAST_ALLOCATED(BeginTransformDisplayItem); | |
16 public: | 15 public: |
17 static PassOwnPtr<BeginTransformDisplayItem> create(const DisplayItemClientW
rapper& client, const AffineTransform& transform) | |
18 { | |
19 return adoptPtr(new BeginTransformDisplayItem(client, transform)); | |
20 } | |
21 | |
22 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi
neTransform& transform) | 16 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi
neTransform& transform) |
23 : PairedBeginDisplayItem(client, BeginTransform) | 17 : PairedBeginDisplayItem(client, BeginTransform) |
24 , m_transform(transform) { } | 18 , m_transform(transform) { } |
25 | 19 |
26 virtual void replay(GraphicsContext&) override; | 20 virtual void replay(GraphicsContext&) override; |
27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 21 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
28 | 22 |
29 private: | 23 private: |
30 #ifndef NDEBUG | 24 #ifndef NDEBUG |
31 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
final; | 25 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const override
final; |
32 #endif | 26 #endif |
33 | 27 |
34 const AffineTransform m_transform; | 28 const AffineTransform m_transform; |
35 }; | 29 }; |
36 | 30 |
37 class PLATFORM_EXPORT EndTransformDisplayItem : public PairedEndDisplayItem { | 31 class PLATFORM_EXPORT EndTransformDisplayItem : public PairedEndDisplayItem { |
38 WTF_MAKE_FAST_ALLOCATED(EndTransformDisplayItem); | |
39 public: | 32 public: |
40 static PassOwnPtr<EndTransformDisplayItem> create(const DisplayItemClientWra
pper& client) | |
41 { | |
42 return adoptPtr(new EndTransformDisplayItem(client)); | |
43 } | |
44 | |
45 EndTransformDisplayItem(const DisplayItemClientWrapper& client) | 33 EndTransformDisplayItem(const DisplayItemClientWrapper& client) |
46 : PairedEndDisplayItem(client, EndTransform) { } | 34 : PairedEndDisplayItem(client, EndTransform) { } |
47 | 35 |
48 virtual void replay(GraphicsContext&) override; | 36 virtual void replay(GraphicsContext&) override; |
49 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 37 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
50 | 38 |
51 private: | 39 private: |
52 #if ENABLE(ASSERT) | 40 #if ENABLE(ASSERT) |
53 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return otherType == BeginTransform; } | 41 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return otherType == BeginTransform; } |
54 #endif | 42 #endif |
55 }; | 43 }; |
56 | 44 |
57 } // namespace blink | 45 } // namespace blink |
58 | 46 |
59 #endif // TransformDisplayItem_h | 47 #endif // TransformDisplayItem_h |
OLD | NEW |