Index: cc/playback/float_clip_display_item.cc |
diff --git a/cc/playback/float_clip_display_item.cc b/cc/playback/float_clip_display_item.cc |
index b57e640b04490b10a5f6745ed9d33374d35ba9da..ae8e0b5d21219e9867c7ca4e5d851bf9033f9a84 100644 |
--- a/cc/playback/float_clip_display_item.cc |
+++ b/cc/playback/float_clip_display_item.cc |
@@ -13,17 +13,7 @@ |
namespace cc { |
-FloatClipDisplayItem::FloatClipDisplayItem(const gfx::RectF& clip_rect) { |
- SetNew(clip_rect); |
-} |
- |
-FloatClipDisplayItem::FloatClipDisplayItem(const proto::DisplayItem& proto) { |
- DCHECK_EQ(proto::DisplayItem::Type_FloatClip, proto.type()); |
- |
- const proto::FloatClipDisplayItem& details = proto.float_clip_item(); |
- gfx::RectF clip_rect = ProtoToRectF(details.clip_rect()); |
- |
- SetNew(clip_rect); |
+FloatClipDisplayItem::FloatClipDisplayItem() { |
} |
FloatClipDisplayItem::~FloatClipDisplayItem() { |
@@ -31,6 +21,9 @@ |
void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) { |
clip_rect_ = clip_rect; |
+ |
+ DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */, |
+ 0 /* external_memory_usage */); |
} |
void FloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
@@ -38,6 +31,15 @@ |
proto::FloatClipDisplayItem* details = proto->mutable_float_clip_item(); |
RectFToProto(clip_rect_, details->mutable_clip_rect()); |
+} |
+ |
+void FloatClipDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
+ DCHECK_EQ(proto::DisplayItem::Type_FloatClip, proto.type()); |
+ |
+ const proto::FloatClipDisplayItem& details = proto.float_clip_item(); |
+ gfx::RectF clip_rect = ProtoToRectF(details.clip_rect()); |
+ |
+ SetNew(clip_rect); |
} |
void FloatClipDisplayItem::Raster(SkCanvas* canvas, |
@@ -55,15 +57,9 @@ |
clip_rect_.ToString().c_str(), visual_rect.ToString().c_str())); |
} |
-size_t FloatClipDisplayItem::ExternalMemoryUsage() const { |
- return 0; |
-} |
- |
-EndFloatClipDisplayItem::EndFloatClipDisplayItem() {} |
- |
-EndFloatClipDisplayItem::EndFloatClipDisplayItem( |
- const proto::DisplayItem& proto) { |
- DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type()); |
+EndFloatClipDisplayItem::EndFloatClipDisplayItem() { |
+ DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
+ 0 /* external_memory_usage */); |
} |
EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { |
@@ -71,6 +67,10 @@ |
void EndFloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
proto->set_type(proto::DisplayItem::Type_EndFloatClip); |
+} |
+ |
+void EndFloatClipDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
+ DCHECK_EQ(proto::DisplayItem::Type_EndFloatClip, proto.type()); |
} |
void EndFloatClipDisplayItem::Raster( |
@@ -88,8 +88,4 @@ |
visual_rect.ToString().c_str())); |
} |
-size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const { |
- return 0; |
-} |
- |
} // namespace cc |