Index: cc/playback/transform_display_item.cc |
diff --git a/cc/playback/transform_display_item.cc b/cc/playback/transform_display_item.cc |
index 8f7303c712b4bc8f6a93a4f22302e4fcbf04f6a2..f841854f9d268311224fbc7010a16a28277c2794 100644 |
--- a/cc/playback/transform_display_item.cc |
+++ b/cc/playback/transform_display_item.cc |
@@ -12,18 +12,8 @@ |
namespace cc { |
-TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform) |
+TransformDisplayItem::TransformDisplayItem() |
: transform_(gfx::Transform::kSkipInitialization) { |
- SetNew(transform); |
-} |
- |
-TransformDisplayItem::TransformDisplayItem(const proto::DisplayItem& proto) { |
- DCHECK_EQ(proto::DisplayItem::Type_Transform, proto.type()); |
- |
- const proto::TransformDisplayItem& details = proto.transform_item(); |
- gfx::Transform transform = ProtoToTransform(details.transform()); |
- |
- SetNew(transform); |
} |
TransformDisplayItem::~TransformDisplayItem() { |
@@ -31,6 +21,9 @@ |
void TransformDisplayItem::SetNew(const gfx::Transform& transform) { |
transform_ = transform; |
+ |
+ DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */, |
+ 0 /* external_memory_usage */); |
} |
void TransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
@@ -38,6 +31,15 @@ |
proto::TransformDisplayItem* details = proto->mutable_transform_item(); |
TransformToProto(transform_, details->mutable_transform()); |
+} |
+ |
+void TransformDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
+ DCHECK_EQ(proto::DisplayItem::Type_Transform, proto.type()); |
+ |
+ const proto::TransformDisplayItem& details = proto.transform_item(); |
+ gfx::Transform transform = ProtoToTransform(details.transform()); |
+ |
+ SetNew(transform); |
} |
void TransformDisplayItem::Raster(SkCanvas* canvas, |
@@ -56,15 +58,9 @@ |
transform_.ToString().c_str(), visual_rect.ToString().c_str())); |
} |
-size_t TransformDisplayItem::ExternalMemoryUsage() const { |
- return 0; |
-} |
- |
-EndTransformDisplayItem::EndTransformDisplayItem() {} |
- |
-EndTransformDisplayItem::EndTransformDisplayItem( |
- const proto::DisplayItem& proto) { |
- DCHECK_EQ(proto::DisplayItem::Type_EndTransform, proto.type()); |
+EndTransformDisplayItem::EndTransformDisplayItem() { |
+ DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
+ 0 /* external_memory_usage */); |
} |
EndTransformDisplayItem::~EndTransformDisplayItem() { |
@@ -72,6 +68,10 @@ |
void EndTransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
proto->set_type(proto::DisplayItem::Type_EndTransform); |
+} |
+ |
+void EndTransformDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
+ DCHECK_EQ(proto::DisplayItem::Type_EndTransform, proto.type()); |
} |
void EndTransformDisplayItem::Raster( |
@@ -89,8 +89,4 @@ |
visual_rect.ToString().c_str())); |
} |
-size_t EndTransformDisplayItem::ExternalMemoryUsage() const { |
- return 0; |
-} |
- |
} // namespace cc |