OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/solid_color_scrollbar_layer.h" | 5 #include "cc/layers/solid_color_scrollbar_layer.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "cc/layers/layer_impl.h" | 8 #include "cc/layers/layer_impl.h" |
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl( | 13 scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl( |
14 LayerTreeImpl* tree_impl) { | 14 LayerTreeImpl* tree_impl) { |
15 const bool kIsOverlayScrollbar = true; | 15 const bool kIsOverlayScrollbar = true; |
16 return SolidColorScrollbarLayerImpl::Create(tree_impl, | 16 return SolidColorScrollbarLayerImpl::Create(tree_impl, |
17 id(), | 17 id(), |
18 orientation(), | 18 orientation(), |
19 thumb_thickness_, | 19 thumb_thickness_, |
| 20 track_start_, |
20 is_left_side_vertical_scrollbar_, | 21 is_left_side_vertical_scrollbar_, |
21 kIsOverlayScrollbar) | 22 kIsOverlayScrollbar) |
22 .PassAs<LayerImpl>(); | 23 .PassAs<LayerImpl>(); |
23 } | 24 } |
24 | 25 |
25 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create( | 26 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create( |
26 ScrollbarOrientation orientation, | 27 ScrollbarOrientation orientation, |
27 int thumb_thickness, | 28 int thumb_thickness, |
| 29 int track_start, |
28 bool is_left_side_vertical_scrollbar, | 30 bool is_left_side_vertical_scrollbar, |
29 int scroll_layer_id) { | 31 int scroll_layer_id) { |
30 return make_scoped_refptr(new SolidColorScrollbarLayer( | 32 return make_scoped_refptr( |
31 orientation, | 33 new SolidColorScrollbarLayer(orientation, |
32 thumb_thickness, | 34 thumb_thickness, |
33 is_left_side_vertical_scrollbar, | 35 track_start, |
34 scroll_layer_id)); | 36 is_left_side_vertical_scrollbar, |
| 37 scroll_layer_id)); |
35 } | 38 } |
36 | 39 |
37 SolidColorScrollbarLayer::SolidColorScrollbarLayer( | 40 SolidColorScrollbarLayer::SolidColorScrollbarLayer( |
38 ScrollbarOrientation orientation, | 41 ScrollbarOrientation orientation, |
39 int thumb_thickness, | 42 int thumb_thickness, |
| 43 int track_start, |
40 bool is_left_side_vertical_scrollbar, | 44 bool is_left_side_vertical_scrollbar, |
41 int scroll_layer_id) | 45 int scroll_layer_id) |
42 : scroll_layer_id_(Layer::INVALID_ID), | 46 : scroll_layer_id_(Layer::INVALID_ID), |
43 clip_layer_id_(scroll_layer_id), | 47 clip_layer_id_(scroll_layer_id), |
44 orientation_(orientation), | 48 orientation_(orientation), |
45 thumb_thickness_(thumb_thickness), | 49 thumb_thickness_(thumb_thickness), |
| 50 track_start_(track_start), |
46 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {} | 51 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {} |
47 | 52 |
48 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {} | 53 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {} |
49 | 54 |
50 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() { | 55 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() { |
51 return this; | 56 return this; |
52 } | 57 } |
53 | 58 |
54 void SolidColorScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { | 59 void SolidColorScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
55 Layer::PushPropertiesTo(layer); | 60 Layer::PushPropertiesTo(layer); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 95 |
91 clip_layer_id_ = layer_id; | 96 clip_layer_id_ = layer_id; |
92 SetNeedsFullTreeSync(); | 97 SetNeedsFullTreeSync(); |
93 } | 98 } |
94 | 99 |
95 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const { | 100 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const { |
96 return orientation_; | 101 return orientation_; |
97 } | 102 } |
98 | 103 |
99 } // namespace cc | 104 } // namespace cc |
OLD | NEW |