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/playback/transform_display_item.h" | 5 #include "cc/playback/transform_display_item.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void TransformDisplayItem::ToProtobuf( | 39 void TransformDisplayItem::ToProtobuf( |
40 proto::DisplayItem* proto, | 40 proto::DisplayItem* proto, |
41 ImageSerializationProcessor* image_serialization_processor) const { | 41 ImageSerializationProcessor* image_serialization_processor) const { |
42 proto->set_type(proto::DisplayItem::Type_Transform); | 42 proto->set_type(proto::DisplayItem::Type_Transform); |
43 | 43 |
44 proto::TransformDisplayItem* details = proto->mutable_transform_item(); | 44 proto::TransformDisplayItem* details = proto->mutable_transform_item(); |
45 TransformToProto(transform_, details->mutable_transform()); | 45 TransformToProto(transform_, details->mutable_transform()); |
46 } | 46 } |
47 | 47 |
48 void TransformDisplayItem::Raster(SkCanvas* canvas, | 48 void TransformDisplayItem::Raster(SkCanvas* canvas, |
49 const gfx::Rect& canvas_target_playback_rect, | |
50 SkPicture::AbortCallback* callback) const { | 49 SkPicture::AbortCallback* callback) const { |
51 canvas->save(); | 50 canvas->save(); |
52 if (!transform_.IsIdentity()) | 51 if (!transform_.IsIdentity()) |
53 canvas->concat(transform_.matrix()); | 52 canvas->concat(transform_.matrix()); |
54 } | 53 } |
55 | 54 |
56 void TransformDisplayItem::AsValueInto( | 55 void TransformDisplayItem::AsValueInto( |
57 const gfx::Rect& visual_rect, | 56 const gfx::Rect& visual_rect, |
58 base::trace_event::TracedValue* array) const { | 57 base::trace_event::TracedValue* array) const { |
59 array->AppendString(base::StringPrintf( | 58 array->AppendString(base::StringPrintf( |
(...skipping 16 matching lines...) Expand all Loading... |
76 } | 75 } |
77 | 76 |
78 void EndTransformDisplayItem::ToProtobuf( | 77 void EndTransformDisplayItem::ToProtobuf( |
79 proto::DisplayItem* proto, | 78 proto::DisplayItem* proto, |
80 ImageSerializationProcessor* image_serialization_processor) const { | 79 ImageSerializationProcessor* image_serialization_processor) const { |
81 proto->set_type(proto::DisplayItem::Type_EndTransform); | 80 proto->set_type(proto::DisplayItem::Type_EndTransform); |
82 } | 81 } |
83 | 82 |
84 void EndTransformDisplayItem::Raster( | 83 void EndTransformDisplayItem::Raster( |
85 SkCanvas* canvas, | 84 SkCanvas* canvas, |
86 const gfx::Rect& canvas_target_playback_rect, | |
87 SkPicture::AbortCallback* callback) const { | 85 SkPicture::AbortCallback* callback) const { |
88 canvas->restore(); | 86 canvas->restore(); |
89 } | 87 } |
90 | 88 |
91 void EndTransformDisplayItem::AsValueInto( | 89 void EndTransformDisplayItem::AsValueInto( |
92 const gfx::Rect& visual_rect, | 90 const gfx::Rect& visual_rect, |
93 base::trace_event::TracedValue* array) const { | 91 base::trace_event::TracedValue* array) const { |
94 array->AppendString( | 92 array->AppendString( |
95 base::StringPrintf("EndTransformDisplayItem visualRect: [%s]", | 93 base::StringPrintf("EndTransformDisplayItem visualRect: [%s]", |
96 visual_rect.ToString().c_str())); | 94 visual_rect.ToString().c_str())); |
97 } | 95 } |
98 | 96 |
99 size_t EndTransformDisplayItem::ExternalMemoryUsage() const { | 97 size_t EndTransformDisplayItem::ExternalMemoryUsage() const { |
100 return 0; | 98 return 0; |
101 } | 99 } |
102 | 100 |
103 } // namespace cc | 101 } // namespace cc |
OLD | NEW |