| 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" | |
| 11 | 10 |
| 12 namespace blink { | 11 namespace blink { |
| 13 | 12 |
| 14 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem
{ | 13 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem
{ |
| 15 WTF_MAKE_FAST_ALLOCATED(BeginTransformDisplayItem); | |
| 16 public: | 14 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) | 15 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi
neTransform& transform) |
| 23 : PairedBeginDisplayItem(client, BeginTransform) | 16 : PairedBeginDisplayItem(client, BeginTransform) |
| 24 , m_transform(transform) { } | 17 , m_transform(transform) { } |
| 25 | 18 |
| 26 virtual void replay(GraphicsContext&) override; | 19 virtual void replay(GraphicsContext&) override; |
| 27 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 20 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 21 void appendByMoving(DisplayItems&) 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; |
| 38 void appendByMoving(DisplayItems&) override; |
| 50 | 39 |
| 51 private: | 40 private: |
| 52 #if ENABLE(ASSERT) | 41 #if ENABLE(ASSERT) |
| 53 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return otherType == BeginTransform; } | 42 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return otherType == BeginTransform; } |
| 54 #endif | 43 #endif |
| 55 }; | 44 }; |
| 56 | 45 |
| 57 } // namespace blink | 46 } // namespace blink |
| 58 | 47 |
| 59 #endif // TransformDisplayItem_h | 48 #endif // TransformDisplayItem_h |
| OLD | NEW |