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/painted_scrollbar_layer_impl.h" | 5 #include "cc/layers/painted_scrollbar_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
9 #include "cc/input/scrollbar_animation_controller.h" | 10 #include "cc/input/scrollbar_animation_controller.h" |
10 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
11 #include "cc/quads/solid_color_draw_quad.h" | 12 #include "cc/quads/solid_color_draw_quad.h" |
12 #include "cc/quads/texture_draw_quad.h" | 13 #include "cc/quads/texture_draw_quad.h" |
13 #include "cc/trees/layer_tree_impl.h" | 14 #include "cc/trees/layer_tree_impl.h" |
14 #include "cc/trees/layer_tree_settings.h" | 15 #include "cc/trees/layer_tree_settings.h" |
15 #include "cc/trees/occlusion.h" | 16 #include "cc/trees/occlusion.h" |
16 #include "ui/gfx/geometry/rect_conversions.h" | 17 #include "ui/gfx/geometry/rect_conversions.h" |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
19 | 20 |
20 scoped_ptr<PaintedScrollbarLayerImpl> PaintedScrollbarLayerImpl::Create( | 21 std::unique_ptr<PaintedScrollbarLayerImpl> PaintedScrollbarLayerImpl::Create( |
21 LayerTreeImpl* tree_impl, | 22 LayerTreeImpl* tree_impl, |
22 int id, | 23 int id, |
23 ScrollbarOrientation orientation) { | 24 ScrollbarOrientation orientation) { |
24 return make_scoped_ptr( | 25 return base::WrapUnique( |
25 new PaintedScrollbarLayerImpl(tree_impl, id, orientation)); | 26 new PaintedScrollbarLayerImpl(tree_impl, id, orientation)); |
26 } | 27 } |
27 | 28 |
28 PaintedScrollbarLayerImpl::PaintedScrollbarLayerImpl( | 29 PaintedScrollbarLayerImpl::PaintedScrollbarLayerImpl( |
29 LayerTreeImpl* tree_impl, | 30 LayerTreeImpl* tree_impl, |
30 int id, | 31 int id, |
31 ScrollbarOrientation orientation) | 32 ScrollbarOrientation orientation) |
32 : ScrollbarLayerImplBase(tree_impl, id, orientation, false, false), | 33 : ScrollbarLayerImplBase(tree_impl, id, orientation, false, false), |
33 track_ui_resource_id_(0), | 34 track_ui_resource_id_(0), |
34 thumb_ui_resource_id_(0), | 35 thumb_ui_resource_id_(0), |
35 thumb_opacity_(1.f), | 36 thumb_opacity_(1.f), |
36 internal_contents_scale_(1.f), | 37 internal_contents_scale_(1.f), |
37 thumb_thickness_(0), | 38 thumb_thickness_(0), |
38 thumb_length_(0), | 39 thumb_length_(0), |
39 track_start_(0), | 40 track_start_(0), |
40 track_length_(0) {} | 41 track_length_(0) {} |
41 | 42 |
42 PaintedScrollbarLayerImpl::~PaintedScrollbarLayerImpl() {} | 43 PaintedScrollbarLayerImpl::~PaintedScrollbarLayerImpl() {} |
43 | 44 |
44 scoped_ptr<LayerImpl> PaintedScrollbarLayerImpl::CreateLayerImpl( | 45 std::unique_ptr<LayerImpl> PaintedScrollbarLayerImpl::CreateLayerImpl( |
45 LayerTreeImpl* tree_impl) { | 46 LayerTreeImpl* tree_impl) { |
46 return PaintedScrollbarLayerImpl::Create(tree_impl, id(), orientation()); | 47 return PaintedScrollbarLayerImpl::Create(tree_impl, id(), orientation()); |
47 } | 48 } |
48 | 49 |
49 void PaintedScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { | 50 void PaintedScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { |
50 ScrollbarLayerImplBase::PushPropertiesTo(layer); | 51 ScrollbarLayerImplBase::PushPropertiesTo(layer); |
51 | 52 |
52 PaintedScrollbarLayerImpl* scrollbar_layer = | 53 PaintedScrollbarLayerImpl* scrollbar_layer = |
53 static_cast<PaintedScrollbarLayerImpl*>(layer); | 54 static_cast<PaintedScrollbarLayerImpl*>(layer); |
54 | 55 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 190 |
190 bool PaintedScrollbarLayerImpl::IsThumbResizable() const { | 191 bool PaintedScrollbarLayerImpl::IsThumbResizable() const { |
191 return false; | 192 return false; |
192 } | 193 } |
193 | 194 |
194 const char* PaintedScrollbarLayerImpl::LayerTypeAsString() const { | 195 const char* PaintedScrollbarLayerImpl::LayerTypeAsString() const { |
195 return "cc::PaintedScrollbarLayerImpl"; | 196 return "cc::PaintedScrollbarLayerImpl"; |
196 } | 197 } |
197 | 198 |
198 } // namespace cc | 199 } // namespace cc |
OLD | NEW |