Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3306)

Unified Diff: cc/playback/float_clip_display_item.cc

Issue 1521373005: Revert of cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/playback/float_clip_display_item.h ('k') | cc/playback/transform_display_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/playback/float_clip_display_item.h ('k') | cc/playback/transform_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698