| 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 DisplayItemClientWrapper& client, const Affi
neTransform& 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&) override; | 20 void replay(GraphicsContext&) override; |
| 21 void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 21 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 22 | 22 |
| 23 const AffineTransform& transform() const { return m_transform; } |
| 24 |
| 23 private: | 25 private: |
| 24 #ifndef NDEBUG | 26 #ifndef NDEBUG |
| 25 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; | 27 void dumpPropertiesAsDebugString(WTF::StringBuilder&) const final; |
| 26 #endif | 28 #endif |
| 27 | 29 |
| 30 private: |
| 28 const AffineTransform m_transform; | 31 const AffineTransform m_transform; |
| 29 }; | 32 }; |
| 30 | 33 |
| 31 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { | 34 class PLATFORM_EXPORT EndTransformDisplayItem final : public PairedEndDisplayIte
m { |
| 32 public: | 35 public: |
| 33 EndTransformDisplayItem(const DisplayItemClientWrapper& client) | 36 EndTransformDisplayItem(const DisplayItemClientWrapper& client) |
| 34 : PairedEndDisplayItem(client, EndTransform, sizeof(*this)) { } | 37 : PairedEndDisplayItem(client, EndTransform, sizeof(*this)) { } |
| 35 | 38 |
| 36 void replay(GraphicsContext&) override; | 39 void replay(GraphicsContext&) override; |
| 37 void appendToWebDisplayItemList(WebDisplayItemList*) const override; | 40 void appendToWebDisplayItemList(WebDisplayItemList*) const override; |
| 38 | 41 |
| 39 private: | 42 private: |
| 40 #if ENABLE(ASSERT) | 43 #if ENABLE(ASSERT) |
| 41 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginTransform; } | 44 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginTransform; } |
| 42 #endif | 45 #endif |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace blink | 48 } // namespace blink |
| 46 | 49 |
| 47 #endif // TransformDisplayItem_h | 50 #endif // TransformDisplayItem_h |
| OLD | NEW |