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 8b29fc214c55c3cf43492c32d1269591e641d38b..f1ff6cb5a9b52e1d66f5786600072ac1d979ddd3 100644 |
--- a/cc/playback/float_clip_display_item.cc |
+++ b/cc/playback/float_clip_display_item.cc |
@@ -6,6 +6,8 @@ |
#include "base/strings/stringprintf.h" |
#include "base/trace_event/trace_event_argument.h" |
+#include "cc/proto/display_item.pb.h" |
+#include "cc/proto/gfx_conversions.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
#include "ui/gfx/skia_util.h" |
@@ -24,6 +26,22 @@ void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) { |
0 /* external_memory_usage */); |
} |
+void FloatClipDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
+ proto->set_type(proto::DisplayItem::Type_FloatClip); |
+ |
+ 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, |
const gfx::Rect& canvas_target_playback_rect, |
SkPicture::AbortCallback* callback) const { |
@@ -45,6 +63,14 @@ EndFloatClipDisplayItem::EndFloatClipDisplayItem() { |
EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { |
} |
+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, |