summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authornyquist <nyquist@chromium.org>2016-02-18 16:30:41 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-19 00:33:35 +0000
commit607e072e9446ce309bdcbe7e86c6d86624b1ca40 (patch)
tree94938e43f7155e54ec3471952ce2359a2b09fc2f /cc
parentf954c033d5551a20224ecf83904457066a6ae1ec (diff)
downloadchromium_src-607e072e9446ce309bdcbe7e86c6d86624b1ca40.zip
chromium_src-607e072e9446ce309bdcbe7e86c6d86624b1ca40.tar.gz
chromium_src-607e072e9446ce309bdcbe7e86c6d86624b1ca40.tar.bz2
Move LayerType to LayerNode::Type
The LayerType was accidentally put into the cc::proto namespace instead of being a part of LayerNode. Note: This is a breaking change for the protobufs. BUG=None CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1689863003 Cr-Commit-Position: refs/heads/master@{#376308}
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/heads_up_display_layer.cc2
-rw-r--r--cc/layers/layer.cc2
-rw-r--r--cc/layers/layer_proto_converter.cc8
-rw-r--r--cc/layers/layer_proto_converter_unittest.cc32
-rw-r--r--cc/layers/picture_layer.cc2
-rw-r--r--cc/proto/layer.proto24
-rw-r--r--cc/trees/layer_tree_host_unittest_serialization.cc2
7 files changed, 36 insertions, 36 deletions
diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc
index 158186f..fe2aa55 100644
--- a/cc/layers/heads_up_display_layer.cc
+++ b/cc/layers/heads_up_display_layer.cc
@@ -64,7 +64,7 @@ scoped_ptr<LayerImpl> HeadsUpDisplayLayer::CreateLayerImpl(
void HeadsUpDisplayLayer::SetTypeForProtoSerialization(
proto::LayerNode* proto) const {
- proto->set_type(proto::LayerType::HEADS_UP_DISPLAY_LAYER);
+ proto->set_type(proto::LayerNode::HEADS_UP_DISPLAY_LAYER);
}
} // namespace cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index c6949a1..8d58b31 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1384,7 +1384,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
}
void Layer::SetTypeForProtoSerialization(proto::LayerNode* proto) const {
- proto->set_type(proto::LayerType::LAYER);
+ proto->set_type(proto::LayerNode::LAYER);
}
void Layer::ToLayerNodeProto(proto::LayerNode* proto) const {
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index 399985c..19215c9 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -111,13 +111,13 @@ scoped_refptr<Layer> LayerProtoConverter::FindOrAllocateAndConstruct(
// 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:
+ case proto::LayerNode::UNKNOWN:
+ case proto::LayerNode::LAYER:
return Layer::Create(LayerSettings()).get();
- case proto::PICTURE_LAYER:
+ case proto::LayerNode::PICTURE_LAYER:
return PictureLayer::Create(LayerSettings(),
EmptyContentLayerClient::GetInstance());
- case proto::HEADS_UP_DISPLAY_LAYER:
+ case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
return HeadsUpDisplayLayer::Create(LayerSettings());
}
// TODO(nyquist): Add the rest of the necessary LayerTypes. This function
diff --git a/cc/layers/layer_proto_converter_unittest.cc b/cc/layers/layer_proto_converter_unittest.cc
index fbd13e1..e72ab58 100644
--- a/cc/layers/layer_proto_converter_unittest.cc
+++ b/cc/layers/layer_proto_converter_unittest.cc
@@ -51,21 +51,21 @@ TEST_F(LayerProtoConverterTest, TestKeepingRoot) {
scoped_refptr<Layer> old_root = Layer::Create(LayerSettings());
proto::LayerNode root_node;
root_node.set_id(old_root->id());
- root_node.set_type(proto::LayerType::LAYER);
+ root_node.set_type(proto::LayerNode::LAYER);
proto::LayerNode* child_a_node = root_node.add_children();
child_a_node->set_id(442);
- child_a_node->set_type(proto::LayerType::LAYER);
+ child_a_node->set_type(proto::LayerNode::LAYER);
child_a_node->set_parent_id(old_root->id()); // root_node
proto::LayerNode* child_b_node = root_node.add_children();
child_b_node->set_id(443);
- child_b_node->set_type(proto::LayerType::LAYER);
+ child_b_node->set_type(proto::LayerNode::LAYER);
child_b_node->set_parent_id(old_root->id()); // root_node
proto::LayerNode* child_c_node = child_b_node->add_children();
child_c_node->set_id(444);
- child_c_node->set_type(proto::LayerType::LAYER);
+ child_c_node->set_type(proto::LayerNode::LAYER);
child_c_node->set_parent_id(child_b_node->id());
scoped_refptr<Layer> new_root =
@@ -97,11 +97,11 @@ TEST_F(LayerProtoConverterTest, TestNoExistingRoot) {
int new_root_id = 244;
proto::LayerNode root_node;
root_node.set_id(new_root_id);
- root_node.set_type(proto::LayerType::LAYER);
+ root_node.set_type(proto::LayerNode::LAYER);
proto::LayerNode* child_a_node = root_node.add_children();
child_a_node->set_id(442);
- child_a_node->set_type(proto::LayerType::LAYER);
+ child_a_node->set_type(proto::LayerNode::LAYER);
child_a_node->set_parent_id(new_root_id); // root_node
scoped_refptr<Layer> new_root =
@@ -127,21 +127,21 @@ TEST_F(LayerProtoConverterTest, TestSwappingRoot) {
*/
proto::LayerNode root_node;
root_node.set_id(441);
- root_node.set_type(proto::LayerType::LAYER);
+ root_node.set_type(proto::LayerNode::LAYER);
proto::LayerNode* child_a_node = root_node.add_children();
child_a_node->set_id(442);
- child_a_node->set_type(proto::LayerType::LAYER);
+ child_a_node->set_type(proto::LayerNode::LAYER);
child_a_node->set_parent_id(root_node.id());
proto::LayerNode* child_b_node = root_node.add_children();
child_b_node->set_id(443);
- child_b_node->set_type(proto::LayerType::LAYER);
+ child_b_node->set_type(proto::LayerNode::LAYER);
child_b_node->set_parent_id(root_node.id());
proto::LayerNode* child_c_node = child_b_node->add_children();
child_c_node->set_id(444);
- child_c_node->set_type(proto::LayerType::LAYER);
+ child_c_node->set_type(proto::LayerNode::LAYER);
child_c_node->set_parent_id(child_b_node->id());
scoped_refptr<Layer> old_root = Layer::Create(LayerSettings());
@@ -379,7 +379,7 @@ TEST_F(LayerProtoConverterTest, PictureLayerTypeSerialization) {
proto::LayerNode layer_hierarchy;
LayerProtoConverter::SerializeLayerHierarchy(layer.get(), &layer_hierarchy);
- EXPECT_EQ(proto::LayerType::PICTURE_LAYER, layer_hierarchy.type());
+ EXPECT_EQ(proto::LayerNode::PICTURE_LAYER, layer_hierarchy.type());
}
TEST_F(LayerProtoConverterTest, PictureLayerTypeDeserialization) {
@@ -389,7 +389,7 @@ TEST_F(LayerProtoConverterTest, PictureLayerTypeDeserialization) {
LayerSettings(), EmptyContentLayerClient::GetInstance());
proto::LayerNode root_node;
root_node.set_id(old_root->id());
- root_node.set_type(proto::LayerType::PICTURE_LAYER);
+ root_node.set_type(proto::LayerNode::PICTURE_LAYER);
scoped_refptr<Layer> new_root =
LayerProtoConverter::DeserializeLayerHierarchy(old_root, root_node);
@@ -401,7 +401,7 @@ TEST_F(LayerProtoConverterTest, PictureLayerTypeDeserialization) {
// serialize to.
proto::LayerNode layer_node;
new_root->SetTypeForProtoSerialization(&layer_node);
- EXPECT_EQ(proto::LayerType::PICTURE_LAYER, layer_node.type());
+ EXPECT_EQ(proto::LayerNode::PICTURE_LAYER, layer_node.type());
}
TEST_F(LayerProtoConverterTest, HudLayerTypeSerialization) {
@@ -412,7 +412,7 @@ TEST_F(LayerProtoConverterTest, HudLayerTypeSerialization) {
proto::LayerNode layer_hierarchy;
LayerProtoConverter::SerializeLayerHierarchy(layer.get(), &layer_hierarchy);
- EXPECT_EQ(proto::LayerType::HEADS_UP_DISPLAY_LAYER, layer_hierarchy.type());
+ EXPECT_EQ(proto::LayerNode::HEADS_UP_DISPLAY_LAYER, layer_hierarchy.type());
}
TEST_F(LayerProtoConverterTest, HudLayerTypeDeserialization) {
@@ -421,7 +421,7 @@ TEST_F(LayerProtoConverterTest, HudLayerTypeDeserialization) {
scoped_refptr<Layer> old_root = HeadsUpDisplayLayer::Create(LayerSettings());
proto::LayerNode root_node;
root_node.set_id(old_root->id());
- root_node.set_type(proto::LayerType::HEADS_UP_DISPLAY_LAYER);
+ root_node.set_type(proto::LayerNode::HEADS_UP_DISPLAY_LAYER);
scoped_refptr<Layer> new_root =
LayerProtoConverter::DeserializeLayerHierarchy(old_root, root_node);
@@ -433,7 +433,7 @@ TEST_F(LayerProtoConverterTest, HudLayerTypeDeserialization) {
// serialize to.
proto::LayerNode layer_node;
new_root->SetTypeForProtoSerialization(&layer_node);
- EXPECT_EQ(proto::LayerType::HEADS_UP_DISPLAY_LAYER, layer_node.type());
+ EXPECT_EQ(proto::LayerNode::HEADS_UP_DISPLAY_LAYER, layer_node.type());
}
} // namespace
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 0102db4..afb62c0 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -186,7 +186,7 @@ bool PictureLayer::HasDrawableContent() const {
}
void PictureLayer::SetTypeForProtoSerialization(proto::LayerNode* proto) const {
- proto->set_type(proto::LayerType::PICTURE_LAYER);
+ proto->set_type(proto::LayerNode::PICTURE_LAYER);
}
void PictureLayer::LayerSpecificPropertiesToProto(
diff --git a/cc/proto/layer.proto b/cc/proto/layer.proto
index 3498c19..e644e55 100644
--- a/cc/proto/layer.proto
+++ b/cc/proto/layer.proto
@@ -20,23 +20,23 @@ package cc.proto;
option optimize_for = LITE_RUNTIME;
-// Identifies the type of cc:Layer a LayerNode represents. It is used to
-// facilitate reconstruction of a Layer of the correct type on the client.
-enum LayerType {
- UNKNOWN = 0;
- LAYER = 1;
- PICTURE_LAYER = 2;
- HEADS_UP_DISPLAY_LAYER = 3;
-
- // TODO(nyquist): Add the rest of the necessary LayerTypes.
-};
-
// Hierarchical structure for serializing the Layer tree.
message LayerNode {
+ // Identifies the type of cc:Layer a LayerNode represents. It is used to
+ // facilitate reconstruction of a Layer of the correct type on the client.
+ enum Type {
+ UNKNOWN = 0;
+ LAYER = 1;
+ PICTURE_LAYER = 2;
+ HEADS_UP_DISPLAY_LAYER = 3;
+
+ // TODO(nyquist): Add the rest of the necessary LayerTypes.
+ };
+
// required
optional int32 id = 1;
// required
- optional LayerType type = 2;
+ optional Type type = 2;
optional int32 parent_id = 3;
// A List of all the children of the current LayerNode.
repeated LayerNode children = 4;
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc
index 50f96d7..66d1242 100644
--- a/cc/trees/layer_tree_host_unittest_serialization.cc
+++ b/cc/trees/layer_tree_host_unittest_serialization.cc
@@ -113,7 +113,7 @@ class LayerTreeHostSerializationTest : public testing::Test {
for (int i = 0; i < proto.root_layer().children_size(); ++i) {
if (proto.root_layer().children(i).id() ==
layer_tree_host_src_->hud_layer_->id()) {
- EXPECT_EQ(proto::HEADS_UP_DISPLAY_LAYER,
+ EXPECT_EQ(proto::LayerNode::HEADS_UP_DISPLAY_LAYER,
proto.root_layer().children(i).type());
found_hud_layer_type = true;
break;