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

Side by Side Diff: cc/layers/layer_proto_converter.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, 1 month 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 unified diff | Download patch
« no previous file with comments | « cc/blimp/layer_factory.h ('k') | cc/proto/layer.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_proto_converter.h" 5 #include "cc/layers/layer_proto_converter.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "cc/layers/empty_content_layer_client.h" 9 #include "cc/layers/empty_content_layer_client.h"
10 #include "cc/layers/heads_up_display_layer.h" 10 #include "cc/layers/heads_up_display_layer.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return iter->second; 92 return iter->second;
93 DCHECK(proto.has_type()); 93 DCHECK(proto.has_type());
94 switch (proto.type()) { 94 switch (proto.type()) {
95 // Fall through and build a base layer. This won't have any special layer 95 // Fall through and build a base layer. This won't have any special layer
96 // properties but still maintains the layer hierarchy if we run into a 96 // properties but still maintains the layer hierarchy if we run into a
97 // layer type we don't support. 97 // layer type we don't support.
98 case proto::LayerNode::UNKNOWN: 98 case proto::LayerNode::UNKNOWN:
99 case proto::LayerNode::LAYER: 99 case proto::LayerNode::LAYER:
100 return Layer::Create().get(); 100 return Layer::Create().get();
101 case proto::LayerNode::PICTURE_LAYER: 101 case proto::LayerNode::PICTURE_LAYER:
102 case proto::LayerNode::FAKE_PICTURE_LAYER:
102 return PictureLayer::Create(EmptyContentLayerClient::GetInstance()); 103 return PictureLayer::Create(EmptyContentLayerClient::GetInstance());
103 case proto::LayerNode::HEADS_UP_DISPLAY_LAYER: 104 case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
104 return HeadsUpDisplayLayer::Create(); 105 return HeadsUpDisplayLayer::Create();
105 case proto::LayerNode::SOLID_COLOR_SCROLLBAR_LAYER: 106 case proto::LayerNode::SOLID_COLOR_SCROLLBAR_LAYER:
106 // Create and return a SolidColorScrollbarLayer with invalid properties 107 // Create and return a SolidColorScrollbarLayer with invalid properties
107 // (orientation, thumb thickness, starting track, left_side_scroll, layer 108 // (orientation, thumb thickness, starting track, left_side_scroll, layer
108 // id etc.). 109 // id etc.).
109 // These properties will be set correctly in the later step when we run 110 // These properties will be set correctly in the later step when we run
110 // through LayerTreeHost and deserialize them for each layer. 111 // through LayerTreeHost and deserialize them for each layer.
111 return SolidColorScrollbarLayer::Create(ScrollbarOrientation::HORIZONTAL, 112 return SolidColorScrollbarLayer::Create(ScrollbarOrientation::HORIZONTAL,
112 -1, -1, false, Layer::INVALID_ID); 113 -1, -1, false, Layer::INVALID_ID);
113 } 114 }
114 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function 115 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function
115 // should not return null. 116 // should not return null.
116 NOTREACHED(); 117 NOTREACHED();
117 return nullptr; 118 return nullptr;
118 } 119 }
119 120
120 } // namespace cc 121 } // namespace cc
OLDNEW
« no previous file with comments | « cc/blimp/layer_factory.h ('k') | cc/proto/layer.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698