OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/layers/solid_color_scrollbar_layer.h" |
| 6 |
| 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "cc/layers/layer_impl.h" |
| 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 10 |
| 11 namespace cc { |
| 12 |
| 13 scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl( |
| 14 LayerTreeImpl* tree_impl) { |
| 15 return SolidColorScrollbarLayerImpl::Create( |
| 16 tree_impl, id(), orientation(), thumb_thickness_).PassAs<LayerImpl>(); |
| 17 } |
| 18 |
| 19 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create( |
| 20 ScrollbarOrientation orientation, |
| 21 int thumb_thickness, |
| 22 int scroll_layer_id) { |
| 23 return make_scoped_refptr(new SolidColorScrollbarLayer(orientation, |
| 24 thumb_thickness, |
| 25 scroll_layer_id)); |
| 26 } |
| 27 |
| 28 SolidColorScrollbarLayer::SolidColorScrollbarLayer( |
| 29 ScrollbarOrientation orientation, |
| 30 int thumb_thickness, |
| 31 int scroll_layer_id) |
| 32 : scroll_layer_id_(scroll_layer_id), |
| 33 orientation_(orientation), |
| 34 thumb_thickness_(thumb_thickness) {} |
| 35 |
| 36 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {} |
| 37 |
| 38 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() { |
| 39 return this; |
| 40 } |
| 41 |
| 42 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 43 return true; |
| 44 } |
| 45 |
| 46 int SolidColorScrollbarLayer::ScrollLayerId() const { |
| 47 return scroll_layer_id_; |
| 48 } |
| 49 |
| 50 void SolidColorScrollbarLayer::SetScrollLayerId(int id) { |
| 51 if (id == scroll_layer_id_) |
| 52 return; |
| 53 |
| 54 scroll_layer_id_ = id; |
| 55 SetNeedsFullTreeSync(); |
| 56 } |
| 57 |
| 58 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const { |
| 59 return orientation_; |
| 60 } |
| 61 |
| 62 } // namespace cc |
OLD | NEW |