| 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 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SolidColorScrollbarLayer::PushScrollClipPropertiesTo(LayerImpl* layer) { | 59 void SolidColorScrollbarLayer::PushScrollClipPropertiesTo(LayerImpl* layer) { |
| 60 SolidColorScrollbarLayerImpl* scrollbar_layer = | 60 SolidColorScrollbarLayerImpl* scrollbar_layer = |
| 61 static_cast<SolidColorScrollbarLayerImpl*>(layer); | 61 static_cast<SolidColorScrollbarLayerImpl*>(layer); |
| 62 | 62 |
| 63 scrollbar_layer->SetScrollLayerById(scroll_layer_id_); | 63 scrollbar_layer->SetScrollLayerById(scroll_layer_id_); |
| 64 scrollbar_layer->SetClipLayerById(clip_layer_id_); | 64 scrollbar_layer->SetClipLayerById(clip_layer_id_); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SolidColorScrollbarLayer::SetNeedsDisplayRect(const gfx::RectF&) { |
| 68 // Never needs repaint. |
| 69 } |
| 70 |
| 67 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 71 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 68 return true; | 72 return true; |
| 69 } | 73 } |
| 70 | 74 |
| 71 int SolidColorScrollbarLayer::ScrollLayerId() const { | 75 int SolidColorScrollbarLayer::ScrollLayerId() const { |
| 72 return scroll_layer_id_; | 76 return scroll_layer_id_; |
| 73 } | 77 } |
| 74 | 78 |
| 75 void SolidColorScrollbarLayer::SetScrollLayer(int layer_id) { | 79 void SolidColorScrollbarLayer::SetScrollLayer(int layer_id) { |
| 76 if (layer_id == scroll_layer_id_) | 80 if (layer_id == scroll_layer_id_) |
| 77 return; | 81 return; |
| 78 | 82 |
| 79 scroll_layer_id_ = layer_id; | 83 scroll_layer_id_ = layer_id; |
| 80 SetNeedsFullTreeSync(); | 84 SetNeedsFullTreeSync(); |
| 81 } | 85 } |
| 82 | 86 |
| 83 void SolidColorScrollbarLayer::SetClipLayer(int layer_id) { | 87 void SolidColorScrollbarLayer::SetClipLayer(int layer_id) { |
| 84 if (layer_id == clip_layer_id_) | 88 if (layer_id == clip_layer_id_) |
| 85 return; | 89 return; |
| 86 | 90 |
| 87 clip_layer_id_ = layer_id; | 91 clip_layer_id_ = layer_id; |
| 88 SetNeedsFullTreeSync(); | 92 SetNeedsFullTreeSync(); |
| 89 } | 93 } |
| 90 | 94 |
| 91 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const { | 95 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const { |
| 92 return orientation_; | 96 return orientation_; |
| 93 } | 97 } |
| 94 | 98 |
| 95 } // namespace cc | 99 } // namespace cc |
| OLD | NEW |