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