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 "cc/resources/transform_display_item.h" | 5 #include "cc/resources/transform_display_item.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform) | 13 TransformDisplayItem::TransformDisplayItem() |
14 : transform_(transform) { | 14 : transform_(gfx::Transform::kSkipInitialization) { |
15 } | 15 } |
16 | 16 |
17 TransformDisplayItem::~TransformDisplayItem() { | 17 TransformDisplayItem::~TransformDisplayItem() { |
18 } | 18 } |
19 | 19 |
| 20 void TransformDisplayItem::SetNew(const gfx::Transform& transform) { |
| 21 transform_ = transform; |
| 22 } |
| 23 |
20 void TransformDisplayItem::Raster(SkCanvas* canvas, | 24 void TransformDisplayItem::Raster(SkCanvas* canvas, |
21 SkDrawPictureCallback* callback) const { | 25 SkDrawPictureCallback* callback) const { |
22 canvas->save(); | 26 canvas->save(); |
23 if (!transform_.IsIdentity()) | 27 if (!transform_.IsIdentity()) |
24 canvas->concat(transform_.matrix()); | 28 canvas->concat(transform_.matrix()); |
25 } | 29 } |
26 | 30 |
27 bool TransformDisplayItem::IsSuitableForGpuRasterization() const { | 31 bool TransformDisplayItem::IsSuitableForGpuRasterization() const { |
28 return true; | 32 return true; |
29 } | 33 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 size_t EndTransformDisplayItem::PictureMemoryUsage() const { | 68 size_t EndTransformDisplayItem::PictureMemoryUsage() const { |
65 return 0; | 69 return 0; |
66 } | 70 } |
67 | 71 |
68 void EndTransformDisplayItem::AsValueInto( | 72 void EndTransformDisplayItem::AsValueInto( |
69 base::trace_event::TracedValue* array) const { | 73 base::trace_event::TracedValue* array) const { |
70 array->AppendString("EndTransformDisplayItem"); | 74 array->AppendString("EndTransformDisplayItem"); |
71 } | 75 } |
72 | 76 |
73 } // namespace cc | 77 } // namespace cc |
OLD | NEW |