| 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 24 matching lines...) Expand all Loading... |
| 35 transform_ = transform; | 35 transform_ = transform; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { | 38 void TransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
| 39 proto->set_type(proto::DisplayItem::Type_Transform); | 39 proto->set_type(proto::DisplayItem::Type_Transform); |
| 40 | 40 |
| 41 proto::TransformDisplayItem* details = proto->mutable_transform_item(); | 41 proto::TransformDisplayItem* details = proto->mutable_transform_item(); |
| 42 TransformToProto(transform_, details->mutable_transform()); | 42 TransformToProto(transform_, details->mutable_transform()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void TransformDisplayItem::Raster(SkCanvas* canvas, | 45 void TransformDisplayItem::Raster(CdlCanvas* canvas, |
| 46 SkPicture::AbortCallback* callback) const { | 46 SkPicture::AbortCallback* callback) const { |
| 47 canvas->save(); | 47 canvas->save(); |
| 48 if (!transform_.IsIdentity()) | 48 if (!transform_.IsIdentity()) |
| 49 canvas->concat(transform_.matrix()); | 49 canvas->concat(transform_.matrix()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void TransformDisplayItem::AsValueInto( | 52 void TransformDisplayItem::AsValueInto( |
| 53 const gfx::Rect& visual_rect, | 53 const gfx::Rect& visual_rect, |
| 54 base::trace_event::TracedValue* array) const { | 54 base::trace_event::TracedValue* array) const { |
| 55 array->AppendString(base::StringPrintf( | 55 array->AppendString(base::StringPrintf( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 DCHECK_EQ(proto::DisplayItem::Type_EndTransform, proto.type()); | 68 DCHECK_EQ(proto::DisplayItem::Type_EndTransform, proto.type()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 EndTransformDisplayItem::~EndTransformDisplayItem() { | 71 EndTransformDisplayItem::~EndTransformDisplayItem() { |
| 72 } | 72 } |
| 73 | 73 |
| 74 void EndTransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { | 74 void EndTransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
| 75 proto->set_type(proto::DisplayItem::Type_EndTransform); | 75 proto->set_type(proto::DisplayItem::Type_EndTransform); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void EndTransformDisplayItem::Raster( | 78 void EndTransformDisplayItem::Raster(CdlCanvas* canvas, |
| 79 SkCanvas* canvas, | 79 SkPicture::AbortCallback* callback) const { |
| 80 SkPicture::AbortCallback* callback) const { | |
| 81 canvas->restore(); | 80 canvas->restore(); |
| 82 } | 81 } |
| 83 | 82 |
| 84 void EndTransformDisplayItem::AsValueInto( | 83 void EndTransformDisplayItem::AsValueInto( |
| 85 const gfx::Rect& visual_rect, | 84 const gfx::Rect& visual_rect, |
| 86 base::trace_event::TracedValue* array) const { | 85 base::trace_event::TracedValue* array) const { |
| 87 array->AppendString( | 86 array->AppendString( |
| 88 base::StringPrintf("EndTransformDisplayItem visualRect: [%s]", | 87 base::StringPrintf("EndTransformDisplayItem visualRect: [%s]", |
| 89 visual_rect.ToString().c_str())); | 88 visual_rect.ToString().c_str())); |
| 90 } | 89 } |
| 91 | 90 |
| 92 size_t EndTransformDisplayItem::ExternalMemoryUsage() const { | 91 size_t EndTransformDisplayItem::ExternalMemoryUsage() const { |
| 93 return 0; | 92 return 0; |
| 94 } | 93 } |
| 95 | 94 |
| 96 } // namespace cc | 95 } // namespace cc |
| OLD | NEW |