| 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 #include "platform/graphics/paint/TransformDisplayItem.h" | 5 #include "platform/graphics/paint/TransformDisplayItem.h" |
| 6 | 6 |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 #include "platform/transforms/AffineTransform.h" | 8 #include "platform/transforms/AffineTransform.h" |
| 9 #include "public/platform/WebDisplayItemList.h" | 9 #include "public/platform/WebDisplayItemList.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 void BeginTransformDisplayItem::replay(GraphicsContext& context) const | 13 void BeginTransformDisplayItem::replay(GraphicsContext& context) const |
| 14 { | 14 { |
| 15 context.save(); | 15 context.save(); |
| 16 context.concatCTM(m_transform); | 16 context.concatCTM(m_transform); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void BeginTransformDisplayItem::appendToWebDisplayItemList(const IntRect& visual
Rect, WebDisplayItemList* list) const | 19 void BeginTransformDisplayItem::appendToWebDisplayItemList(const IntRect& visual
Rect, WebDisplayItemList* list) const |
| 20 { | 20 { |
| 21 list->appendTransformItem(visualRect, affineTransformToSkMatrix(m_transform)
); | 21 list->appendTransformItem(affineTransformToSkMatrix(m_transform)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 #ifndef NDEBUG | 24 #ifndef NDEBUG |
| 25 void BeginTransformDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder&
stringBuilder) const | 25 void BeginTransformDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder&
stringBuilder) const |
| 26 { | 26 { |
| 27 PairedBeginDisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 27 PairedBeginDisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
| 28 stringBuilder.append(WTF::String::format(", transform: [%lf,%lf,%lf,%lf,%lf,
%lf]", | 28 stringBuilder.append(WTF::String::format(", transform: [%lf,%lf,%lf,%lf,%lf,
%lf]", |
| 29 m_transform.a(), m_transform.b(), m_transform.c(), m_transform.d(), m_tr
ansform.e(), m_transform.f())); | 29 m_transform.a(), m_transform.b(), m_transform.c(), m_transform.d(), m_tr
ansform.e(), m_transform.f())); |
| 30 } | 30 } |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 void EndTransformDisplayItem::replay(GraphicsContext& context) const | 33 void EndTransformDisplayItem::replay(GraphicsContext& context) const |
| 34 { | 34 { |
| 35 context.restore(); | 35 context.restore(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void EndTransformDisplayItem::appendToWebDisplayItemList(const IntRect& visualRe
ct, WebDisplayItemList* list) const | 38 void EndTransformDisplayItem::appendToWebDisplayItemList(const IntRect& visualRe
ct, WebDisplayItemList* list) const |
| 39 { | 39 { |
| 40 list->appendEndTransformItem(visualRect); | 40 list->appendEndTransformItem(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace blink | 43 } // namespace blink |
| OLD | NEW |