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

Unified Diff: cc/playback/transform_display_item.cc

Issue 1494223003: cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some compilation issues in ui oops 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 f841854f9d268311224fbc7010a16a28277c2794..8f7303c712b4bc8f6a93a4f22302e4fcbf04f6a2 100644
--- a/cc/playback/transform_display_item.cc
+++ b/cc/playback/transform_display_item.cc
@@ -12,8 +12,18 @@
namespace cc {
-TransformDisplayItem::TransformDisplayItem()
+TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform)
: 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() {
@@ -21,9 +31,6 @@ TransformDisplayItem::~TransformDisplayItem() {
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 {
@@ -33,15 +40,6 @@ void TransformDisplayItem::ToProtobuf(proto::DisplayItem* proto) const {
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,
const gfx::Rect& canvas_target_playback_rect,
SkPicture::AbortCallback* callback) const {
@@ -58,9 +56,15 @@ void TransformDisplayItem::AsValueInto(
transform_.ToString().c_str(), visual_rect.ToString().c_str()));
}
-EndTransformDisplayItem::EndTransformDisplayItem() {
- DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
- 0 /* external_memory_usage */);
+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() {
@@ -70,10 +74,6 @@ 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(
SkCanvas* canvas,
const gfx::Rect& canvas_target_playback_rect,
@@ -89,4 +89,8 @@ void EndTransformDisplayItem::AsValueInto(
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