| 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.h" | 5 #include "cc/layers/painted_scrollbar_layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 scroll_element_id_ = element_id; | 68 scroll_element_id_ = element_id; |
| 69 SetNeedsFullTreeSync(); | 69 SetNeedsFullTreeSync(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 72 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 73 return scrollbar_->IsOverlay(); | 73 return scrollbar_->IsOverlay(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool PaintedScrollbarLayer::AlwaysUseActiveTreeOpacity() const { | |
| 77 return true; | |
| 78 } | |
| 79 | |
| 80 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { | 76 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { |
| 81 return scrollbar_->Orientation(); | 77 return scrollbar_->Orientation(); |
| 82 } | 78 } |
| 83 | 79 |
| 84 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { | 80 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
| 85 Layer::PushPropertiesTo(layer); | 81 Layer::PushPropertiesTo(layer); |
| 86 | 82 |
| 87 PaintedScrollbarLayerImpl* scrollbar_layer = | 83 PaintedScrollbarLayerImpl* scrollbar_layer = |
| 88 static_cast<PaintedScrollbarLayerImpl*>(layer); | 84 static_cast<PaintedScrollbarLayerImpl*>(layer); |
| 89 | 85 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 281 |
| 286 scrollbar_->PaintPart(&canvas, part, layer_rect); | 282 scrollbar_->PaintPart(&canvas, part, layer_rect); |
| 287 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 283 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
| 288 // allocation and copying. | 284 // allocation and copying. |
| 289 skbitmap.setImmutable(); | 285 skbitmap.setImmutable(); |
| 290 | 286 |
| 291 return UIResourceBitmap(skbitmap); | 287 return UIResourceBitmap(skbitmap); |
| 292 } | 288 } |
| 293 | 289 |
| 294 } // namespace cc | 290 } // namespace cc |
| OLD | NEW |