| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 AddMainThreadScrollingReasons( | 54 AddMainThreadScrollingReasons( |
| 55 MainThreadScrollingReason::kScrollbarScrolling); | 55 MainThreadScrollingReason::kScrollbarScrolling); |
| 56 } | 56 } |
| 57 | 57 |
| 58 PaintedScrollbarLayer::~PaintedScrollbarLayer() {} | 58 PaintedScrollbarLayer::~PaintedScrollbarLayer() {} |
| 59 | 59 |
| 60 int PaintedScrollbarLayer::ScrollLayerId() const { | 60 int PaintedScrollbarLayer::ScrollLayerId() const { |
| 61 return scroll_layer_id_; | 61 return scroll_layer_id_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void PaintedScrollbarLayer::SetScrollLayer(int layer_id) { | |
| 65 if (layer_id == scroll_layer_id_) | |
| 66 return; | |
| 67 | |
| 68 scroll_layer_id_ = layer_id; | |
| 69 SetNeedsFullTreeSync(); | |
| 70 } | |
| 71 | |
| 72 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 64 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 73 return scrollbar_->IsOverlay(); | 65 return scrollbar_->IsOverlay(); |
| 74 } | 66 } |
| 75 | 67 |
| 76 bool PaintedScrollbarLayer::AlwaysUseActiveTreeOpacity() const { | 68 bool PaintedScrollbarLayer::AlwaysUseActiveTreeOpacity() const { |
| 77 return true; | 69 return true; |
| 78 } | 70 } |
| 79 | 71 |
| 80 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { | 72 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { |
| 81 return scrollbar_->Orientation(); | 73 return scrollbar_->Orientation(); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 277 |
| 286 scrollbar_->PaintPart(&canvas, part, layer_rect); | 278 scrollbar_->PaintPart(&canvas, part, layer_rect); |
| 287 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 279 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
| 288 // allocation and copying. | 280 // allocation and copying. |
| 289 skbitmap.setImmutable(); | 281 skbitmap.setImmutable(); |
| 290 | 282 |
| 291 return UIResourceBitmap(skbitmap); | 283 return UIResourceBitmap(skbitmap); |
| 292 } | 284 } |
| 293 | 285 |
| 294 } // namespace cc | 286 } // namespace cc |
| OLD | NEW |