| 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 final : public PairedBeginDispla
yItem { | 14 class PLATFORM_EXPORT BeginTransformDisplayItem final : public PairedBeginDispla
yItem { |
| 15 public: | 15 public: |
| 16 BeginTransformDisplayItem(const DisplayItemClientWrapper& client, const Affi
neTransform& transform) | 16 BeginTransformDisplayItem(const DisplayItemClient& client, const AffineTrans
form& transform) |
| 17 : PairedBeginDisplayItem(client, BeginTransform, sizeof(*this)) | 17 : PairedBeginDisplayItem(client, BeginTransform, sizeof(*this)) |
| 18 , m_transform(transform) { } | 18 , m_transform(transform) { } |
| 19 | 19 |
| 20 void replay(GraphicsContext&) const override; | 20 void replay(GraphicsContext&) const override; |
| 21 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 21 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 22 | 22 |
| 23 const AffineTransform& transform() const { return m_transform; } | 23 const AffineTransform& transform() const { return m_transform; } |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 #ifndef NDEBUG | 26 #ifndef NDEBUG |
| 27 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; | 27 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; |
| 28 #endif | 28 #endif |
| 29 #if ENABLE(ASSERT) | 29 #if ENABLE(ASSERT) |
| 30 bool equals(const DisplayItem& other) const final | 30 bool equals(const DisplayItem& other) const final |
| 31 { | 31 { |
| 32 return DisplayItem::equals(other) | 32 return DisplayItem::equals(other) |
| 33 && m_transform == static_cast<const BeginTransformDisplayItem&>(othe
r).m_transform; | 33 && m_transform == static_cast<const BeginTransformDisplayItem&>(othe
r).m_transform; |
| 34 } | 34 } |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 const AffineTransform m_transform; | 37 const AffineTransform m_transform; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { | 40 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { |
| 41 public: | 41 public: |
| 42 EndTransformDisplayItem(const DisplayItemClientWrapper& client) | 42 EndTransformDisplayItem(const DisplayItemClient& client) |
| 43 : PairedEndDisplayItem(client, EndTransform, sizeof(*this)) { } | 43 : PairedEndDisplayItem(client, EndTransform, sizeof(*this)) { } |
| 44 | 44 |
| 45 void replay(GraphicsContext&) const override; | 45 void replay(GraphicsContext&) const override; |
| 46 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; | 46 void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*) const o
verride; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 #if ENABLE(ASSERT) | 49 #if ENABLE(ASSERT) |
| 50 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginTransform; } | 50 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginTransform; } |
| 51 #endif | 51 #endif |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace blink | 54 } // namespace blink |
| 55 | 55 |
| 56 #endif // TransformDisplayItem_h | 56 #endif // TransformDisplayItem_h |
| OLD | NEW |