OLD | NEW |
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 |
OLD | NEW |