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

Unified Diff: cc/blimp/compositor_state_deserializer.cc

Issue 2451913002: Add serialization/deserialization for FakePictureLayer for testing. (Closed)
Patch Set: Revert change from another CL, that I cl patch this one to that one. 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
« no previous file with comments | « no previous file | cc/blimp/layer_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blimp/compositor_state_deserializer.cc
diff --git a/cc/blimp/compositor_state_deserializer.cc b/cc/blimp/compositor_state_deserializer.cc
index 7caf0bff3b0d1b4ffc1dd3216de4b3bd17445f11..1c1f82fb51f6f59349733b1f3481c11d5f36634f 100644
--- a/cc/blimp/compositor_state_deserializer.cc
+++ b/cc/blimp/compositor_state_deserializer.cc
@@ -38,6 +38,15 @@ class DefaultLayerFactory : public LayerFactory {
ContentLayerClient* content_layer_client) override {
return PictureLayer::Create(content_layer_client);
}
+
+ scoped_refptr<PictureLayer> CreateFakePictureLayer(
+ int engine_layer_id,
+ ContentLayerClient* content_layer_client) override {
+ // We should never create fake layers in production code.
+ NOTREACHED();
+ return PictureLayer::Create(content_layer_client);
+ }
+
scoped_refptr<SolidColorScrollbarLayer> CreateSolidColorScrollbarLayer(
int engine_layer_id,
ScrollbarOrientation orientation,
@@ -361,6 +370,12 @@ scoped_refptr<Layer> CompositorStateDeserializer::GetLayerAndAddToNewMap(
layer_data.layer = layer_factory_->CreatePictureLayer(
layer_node.id(), layer_data.content_layer_client.get());
break;
+ case proto::LayerNode::FAKE_PICTURE_LAYER:
+ layer_data.content_layer_client =
+ base::MakeUnique<DeserializedContentLayerClient>();
+ layer_data.layer = layer_factory_->CreateFakePictureLayer(
+ layer_node.id(), layer_data.content_layer_client.get());
+ break;
case proto::LayerNode::SOLID_COLOR_SCROLLBAR_LAYER: {
// SolidColorScrollbarLayers attach their properties in the LayerNode
// itself.
« no previous file with comments | « no previous file | cc/blimp/layer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698