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

Unified Diff: cc/layers/picture_layer.cc

Issue 2397843003: cc/blimp: Add (de)-serialization for PictureLayer and ScrollbarLayer. (Closed)
Patch Set: Created 4 years, 2 months 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
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 25e6c3e679b0958eb7c59f853b7e49cb26557a01..881a8b36c3529c8c3f4fef3cd03ebfc96ee25295 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -36,6 +36,14 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
picture_layer_inputs_.client = client;
}
+PictureLayer::PictureLayer(int engine_layer_id, ContentLayerClient* client)
+ : Layer(engine_layer_id),
+ instrumentation_object_tracker_(id()),
+ update_source_frame_number_(-1),
+ is_mask_(false) {
+ picture_layer_inputs_.client = client;
+}
+
PictureLayer::PictureLayer(ContentLayerClient* client,
std::unique_ptr<RecordingSource> source)
: PictureLayer(client) {
@@ -210,10 +218,9 @@ void PictureLayer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto,
bool inputs_only) {
Layer::LayerSpecificPropertiesToProto(proto, inputs_only);
DropRecordingSourceContentIfInvalid();
-
proto::PictureLayerProperties* picture = proto->mutable_picture();
- recording_source_->ToProtobuf(picture->mutable_recording_source());
+ picture->set_nearest_neighbor(picture_layer_inputs_.nearest_neighbor);
RectToProto(picture_layer_inputs_.recorded_viewport,
picture->mutable_recorded_viewport());
if (picture_layer_inputs_.display_list) {
@@ -229,12 +236,13 @@ void PictureLayer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto,
}
}
+ if (inputs_only)
+ return;
+
+ recording_source_->ToProtobuf(picture->mutable_recording_source());
RegionToProto(last_updated_invalidation_, picture->mutable_invalidation());
picture->set_is_mask(is_mask_);
- picture->set_nearest_neighbor(picture_layer_inputs_.nearest_neighbor);
-
picture->set_update_source_frame_number(update_source_frame_number_);
-
last_updated_invalidation_.Clear();
}

Powered by Google App Engine
This is Rietveld 408576698