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

Unified Diff: cc/playback/transform_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/transform_display_item.h ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/playback/transform_display_item.h ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698