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

Side by Side Diff: cc/test/remote_client_layer_factory.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/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" 8 #include "cc/layers/picture_layer.h"
9 #include "cc/layers/solid_color_scrollbar_layer.h" 9 #include "cc/layers/solid_color_scrollbar_layer.h"
10 #include "cc/test/fake_picture_layer.h"
10 11
11 namespace cc { 12 namespace cc {
12 13
13 RemoteClientLayerFactory::RemoteClientLayerFactory() = default; 14 RemoteClientLayerFactory::RemoteClientLayerFactory() = default;
14 15
15 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default; 16 RemoteClientLayerFactory::~RemoteClientLayerFactory() = default;
16 17
17 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer( 18 scoped_refptr<Layer> RemoteClientLayerFactory::CreateLayer(
18 int engine_layer_id) { 19 int engine_layer_id) {
19 scoped_refptr<Layer> layer = Layer::Create(); 20 scoped_refptr<Layer> layer = Layer::Create();
20 layer->SetLayerIdForTesting(engine_layer_id); 21 layer->SetLayerIdForTesting(engine_layer_id);
21 return layer; 22 return layer;
22 } 23 }
23 24
24 scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreatePictureLayer( 25 scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreatePictureLayer(
25 int engine_layer_id, 26 int engine_layer_id,
26 ContentLayerClient* content_layer_client) { 27 ContentLayerClient* content_layer_client) {
27 scoped_refptr<PictureLayer> layer = 28 scoped_refptr<PictureLayer> layer =
28 PictureLayer::Create(content_layer_client); 29 PictureLayer::Create(content_layer_client);
29 layer->SetLayerIdForTesting(engine_layer_id); 30 layer->SetLayerIdForTesting(engine_layer_id);
30 return layer; 31 return layer;
31 } 32 }
32 33
34 scoped_refptr<PictureLayer> RemoteClientLayerFactory::CreateFakePictureLayer(
35 int engine_layer_id,
36 ContentLayerClient* content_layer_client) {
37 scoped_refptr<PictureLayer> layer =
38 FakePictureLayer::Create(content_layer_client);
39 layer->SetLayerIdForTesting(engine_layer_id);
40 return layer;
41 }
42
33 scoped_refptr<SolidColorScrollbarLayer> 43 scoped_refptr<SolidColorScrollbarLayer>
34 RemoteClientLayerFactory::CreateSolidColorScrollbarLayer( 44 RemoteClientLayerFactory::CreateSolidColorScrollbarLayer(
35 int engine_layer_id, 45 int engine_layer_id,
36 ScrollbarOrientation orientation, 46 ScrollbarOrientation orientation,
37 int thumb_thickness, 47 int thumb_thickness,
38 int track_start, 48 int track_start,
39 bool is_left_side_vertical_scrollbar, 49 bool is_left_side_vertical_scrollbar,
40 int scroll_layer_id) { 50 int scroll_layer_id) {
41 scoped_refptr<SolidColorScrollbarLayer> layer = 51 scoped_refptr<SolidColorScrollbarLayer> layer =
42 SolidColorScrollbarLayer::Create( 52 SolidColorScrollbarLayer::Create(
43 orientation, thumb_thickness, track_start, 53 orientation, thumb_thickness, track_start,
44 is_left_side_vertical_scrollbar, scroll_layer_id); 54 is_left_side_vertical_scrollbar, scroll_layer_id);
45 layer->SetLayerIdForTesting(engine_layer_id); 55 layer->SetLayerIdForTesting(engine_layer_id);
46 return layer; 56 return layer;
47 } 57 }
48 58
49 } // namespace cc 59 } // 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