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" |
| 8 #include "base/trace_event/trace_event_argument.h" |
7 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
8 | 10 |
9 namespace cc { | 11 namespace cc { |
10 | 12 |
11 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform) | 13 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform) |
12 : transform_(transform) { | 14 : transform_(transform) { |
13 } | 15 } |
14 | 16 |
15 TransformDisplayItem::~TransformDisplayItem() { | 17 TransformDisplayItem::~TransformDisplayItem() { |
16 } | 18 } |
(...skipping 10 matching lines...) Expand all Loading... |
27 } | 29 } |
28 | 30 |
29 int TransformDisplayItem::ApproximateOpCount() const { | 31 int TransformDisplayItem::ApproximateOpCount() const { |
30 return 1; | 32 return 1; |
31 } | 33 } |
32 | 34 |
33 size_t TransformDisplayItem::PictureMemoryUsage() const { | 35 size_t TransformDisplayItem::PictureMemoryUsage() const { |
34 return sizeof(gfx::Transform); | 36 return sizeof(gfx::Transform); |
35 } | 37 } |
36 | 38 |
| 39 void TransformDisplayItem::AsValueInto(base::debug::TracedValue* array) const { |
| 40 array->AppendString(base::StringPrintf("TransformDisplayItem transform: [%s]", |
| 41 transform_.ToString().c_str())); |
| 42 } |
| 43 |
37 EndTransformDisplayItem::EndTransformDisplayItem() { | 44 EndTransformDisplayItem::EndTransformDisplayItem() { |
38 } | 45 } |
39 | 46 |
40 EndTransformDisplayItem::~EndTransformDisplayItem() { | 47 EndTransformDisplayItem::~EndTransformDisplayItem() { |
41 } | 48 } |
42 | 49 |
43 void EndTransformDisplayItem::Raster(SkCanvas* canvas, | 50 void EndTransformDisplayItem::Raster(SkCanvas* canvas, |
44 SkDrawPictureCallback* callback) const { | 51 SkDrawPictureCallback* callback) const { |
45 canvas->restore(); | 52 canvas->restore(); |
46 } | 53 } |
47 | 54 |
48 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const { | 55 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const { |
49 return true; | 56 return true; |
50 } | 57 } |
51 | 58 |
52 int EndTransformDisplayItem::ApproximateOpCount() const { | 59 int EndTransformDisplayItem::ApproximateOpCount() const { |
53 return 0; | 60 return 0; |
54 } | 61 } |
55 | 62 |
56 size_t EndTransformDisplayItem::PictureMemoryUsage() const { | 63 size_t EndTransformDisplayItem::PictureMemoryUsage() const { |
57 return 0; | 64 return 0; |
58 } | 65 } |
59 | 66 |
| 67 void EndTransformDisplayItem::AsValueInto( |
| 68 base::debug::TracedValue* array) const { |
| 69 array->AppendString("EndTransformDisplayItem"); |
| 70 } |
| 71 |
60 } // namespace cc | 72 } // namespace cc |
OLD | NEW |