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 ae8e0b5d21219e9867c7ca4e5d851bf9033f9a84..b57e640b04490b10a5f6745ed9d33374d35ba9da 100644 |
--- a/cc/playback/float_clip_display_item.cc |
+++ b/cc/playback/float_clip_display_item.cc |
@@ -13,7 +13,17 @@ |
namespace cc { |
-FloatClipDisplayItem::FloatClipDisplayItem() { |
+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() { |
@@ -21,9 +31,6 @@ FloatClipDisplayItem::~FloatClipDisplayItem() { |
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 { |
@@ -33,15 +40,6 @@ void FloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
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, |
const gfx::Rect& canvas_target_playback_rect, |
SkPicture::AbortCallback* callback) const { |
@@ -57,9 +55,15 @@ void FloatClipDisplayItem::AsValueInto( |
clip_rect_.ToString().c_str(), visual_rect.ToString().c_str())); |
} |
-EndFloatClipDisplayItem::EndFloatClipDisplayItem() { |
- DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, |
- 0 /* external_memory_usage */); |
+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() { |
@@ -69,10 +73,6 @@ 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( |
SkCanvas* canvas, |
const gfx::Rect& canvas_target_playback_rect, |
@@ -88,4 +88,8 @@ void EndFloatClipDisplayItem::AsValueInto( |
visual_rect.ToString().c_str())); |
} |
+size_t EndFloatClipDisplayItem::ExternalMemoryUsage() const { |
+ return 0; |
+} |
+ |
} // namespace cc |