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

Side by Side Diff: cc/test/remote_client_layer_factory.cc

Issue 2397843003: cc/blimp: Add (de)-serialization for PictureLayer and ScrollbarLayer. (Closed)
Patch Set: Addressed comments 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 unified diff | Download patch
« no previous file with comments | « cc/test/remote_client_layer_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/remote_client_layer_factory.h" 5 #include "cc/test/remote_client_layer_factory.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/picture_layer.h"
9 #include "cc/layers/solid_color_scrollbar_layer.h"
8 10
9 namespace cc { 11 namespace cc {
10 namespace {
11 class ClientLayer : public Layer {
12 public:
13 explicit ClientLayer(int engine_layer_id) : Layer(engine_layer_id) {}
14
15 private:
16 ~ClientLayer() override {}
17 };
18 } // namespace
19 12
20 RemoteClientLayerFactory::RemoteClientLayerFactory() = default; 13 RemoteClientLayerFactory::RemoteClientLayerFactory() = default;
21 14
22 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default; 15 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default;
23 16
24 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer( 17 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer(
25 int engine_layer_id) { 18 int engine_layer_id) {
26 return make_scoped_refptr(new ClientLayer(engine_layer_id)); 19 scoped_refptr<Layer> layer = Layer::Create();
20 layer->SetLayerIdForTesting(engine_layer_id);
21 return layer;
22 }
23
24 scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreatePictureLayer(
25 int engine_layer_id,
26 ContentLayerClient* content_layer_client) {
27 scoped_refptr<PictureLayer> layer =
28 PictureLayer::Create(content_layer_client);
29 layer->SetLayerIdForTesting(engine_layer_id);
30 return layer;
31 }
32
33 scoped_refptr<SolidColorScrollbarLayer>
34 RemoteClientLayerFactory::CreateSolidColorScrollbarLayer(
35 int engine_layer_id,
36 ScrollbarOrientation orientation,
37 int thumb_thickness,
38 int track_start,
39 bool is_left_side_vertical_scrollbar,
40 int scroll_layer_id) {
41 scoped_refptr<SolidColorScrollbarLayer> layer =
42 SolidColorScrollbarLayer::Create(
43 orientation, thumb_thickness, track_start,
44 is_left_side_vertical_scrollbar, scroll_layer_id);
45 layer->SetLayerIdForTesting(engine_layer_id);
46 return layer;
27 } 47 }
28 48
29 } // namespace cc 49 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/remote_client_layer_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698