| 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 DisplayItem { | 14 class PLATFORM_EXPORT BeginTransformDisplayItem : public PairedBeginDisplayItem
{ |
| 15 WTF_MAKE_FAST_ALLOCATED; | 15 WTF_MAKE_FAST_ALLOCATED; |
| 16 public: | 16 public: |
| 17 static PassOwnPtr<BeginTransformDisplayItem> create(DisplayItemClient client
, const AffineTransform& transform) | 17 static PassOwnPtr<BeginTransformDisplayItem> create(DisplayItemClient client
, const AffineTransform& transform) |
| 18 { | 18 { |
| 19 return adoptPtr(new BeginTransformDisplayItem(client, transform)); | 19 return adoptPtr(new BeginTransformDisplayItem(client, transform)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 BeginTransformDisplayItem(DisplayItemClient client, const AffineTransform& t
ransform) | 22 BeginTransformDisplayItem(DisplayItemClient client, const AffineTransform& t
ransform) |
| 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 AffineTransform m_transform; | 30 const AffineTransform m_transform; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class PLATFORM_EXPORT EndTransformDisplayItem : public DisplayItem { | 33 class PLATFORM_EXPORT EndTransformDisplayItem : public PairedEndDisplayItem { |
| 34 WTF_MAKE_FAST_ALLOCATED; | 34 WTF_MAKE_FAST_ALLOCATED; |
| 35 public: | 35 public: |
| 36 static PassOwnPtr<EndTransformDisplayItem> create(DisplayItemClient client) | 36 static PassOwnPtr<EndTransformDisplayItem> create(DisplayItemClient client) |
| 37 { | 37 { |
| 38 return adoptPtr(new EndTransformDisplayItem(client)); | 38 return adoptPtr(new EndTransformDisplayItem(client)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 EndTransformDisplayItem(DisplayItemClient client) | 41 EndTransformDisplayItem(DisplayItemClient client) |
| 42 : DisplayItem(client, EndTransform) { } | 42 : PairedEndDisplayItem(client, EndTransform) { } |
| 43 | 43 |
| 44 virtual void replay(GraphicsContext*) override; | 44 virtual void replay(GraphicsContext*) override; |
| 45 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 45 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 46 |
| 47 private: |
| 48 #if ENABLE(ASSERT) |
| 49 virtual bool isEndAndPairedWith(const DisplayItem& other) const override fin
al { return other.type() == BeginTransform; } |
| 50 #endif |
| 46 }; | 51 }; |
| 47 | 52 |
| 48 } // namespace blink | 53 } // namespace blink |
| 49 | 54 |
| 50 #endif // TransformDisplayItem_h | 55 #endif // TransformDisplayItem_h |
| OLD | NEW |