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