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

Unified Diff: cc/layers/layer_proto_converter.cc

Issue 1527863002: Serialize PictureLayer properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and added comment Created 4 years, 12 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 | « cc/layers/layer.cc ('k') | cc/layers/layer_proto_converter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_proto_converter.cc
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index 65e1b14ff0c1d4043bbeb7da17e7fa725393e0de..6564e0bf42886c93933c11c8767546dc831715d7 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -5,8 +5,10 @@
#include "cc/layers/layer_proto_converter.h"
#include "base/stl_util.h"
+#include "cc/layers/empty_content_layer_client.h"
#include "cc/layers/layer.h"
#include "cc/layers/layer_settings.h"
+#include "cc/layers/picture_layer.h"
#include "cc/proto/layer.pb.h"
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_settings.h"
@@ -103,8 +105,15 @@ scoped_refptr<Layer> LayerProtoConverter::FindOrAllocateAndConstruct(
return iter->second;
DCHECK(proto.has_type());
switch (proto.type()) {
- case proto::Base:
+ // Fall through and build a base layer. This won't have any special layer
+ // properties but still maintains the layer hierarchy if we run into a
+ // layer type we don't support.
+ case proto::UNKNOWN:
+ case proto::LAYER:
return Layer::Create(LayerSettings()).get();
+ case proto::PICTURE_LAYER:
+ return PictureLayer::Create(LayerSettings(),
+ EmptyContentLayerClient::GetInstance());
}
// TODO(nyquist): Add the rest of the necessary LayerTypes. This function
// should not return null.
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_proto_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698