| 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 context.Save(); | 14 context.Save(); |
| 15 context.ConcatCTM(transform_); | 15 context.ConcatCTM(transform_); |
| 16 } | 16 } |
| 17 | 17 |
| 18 void BeginTransformDisplayItem::AppendToWebDisplayItemList( | 18 void BeginTransformDisplayItem::AppendToWebDisplayItemList( |
| 19 const IntRect& visual_rect, | 19 const LayoutSize&, |
| 20 WebDisplayItemList* list) const { | 20 WebDisplayItemList* list) const { |
| 21 list->AppendTransformItem(AffineTransformToSkMatrix(transform_)); | 21 list->AppendTransformItem(AffineTransformToSkMatrix(transform_)); |
| 22 } | 22 } |
| 23 | 23 |
| 24 #ifndef NDEBUG | 24 #ifndef NDEBUG |
| 25 void BeginTransformDisplayItem::DumpPropertiesAsDebugString( | 25 void BeginTransformDisplayItem::DumpPropertiesAsDebugString( |
| 26 WTF::StringBuilder& string_builder) const { | 26 WTF::StringBuilder& string_builder) const { |
| 27 PairedBeginDisplayItem::DumpPropertiesAsDebugString(string_builder); | 27 PairedBeginDisplayItem::DumpPropertiesAsDebugString(string_builder); |
| 28 string_builder.Append(WTF::String::Format( | 28 string_builder.Append(WTF::String::Format( |
| 29 ", transform: [%lf,%lf,%lf,%lf,%lf,%lf]", transform_.A(), transform_.B(), | 29 ", transform: [%lf,%lf,%lf,%lf,%lf,%lf]", transform_.A(), transform_.B(), |
| 30 transform_.C(), transform_.D(), transform_.E(), transform_.F())); | 30 transform_.C(), transform_.D(), transform_.E(), transform_.F())); |
| 31 } | 31 } |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 void EndTransformDisplayItem::Replay(GraphicsContext& context) const { | 34 void EndTransformDisplayItem::Replay(GraphicsContext& context) const { |
| 35 context.Restore(); | 35 context.Restore(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void EndTransformDisplayItem::AppendToWebDisplayItemList( | 38 void EndTransformDisplayItem::AppendToWebDisplayItemList( |
| 39 const IntRect& visual_rect, | 39 const LayoutSize&, |
| 40 WebDisplayItemList* list) const { | 40 WebDisplayItemList* list) const { |
| 41 list->AppendEndTransformItem(); | 41 list->AppendEndTransformItem(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |