| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_overlay_scrollbar_layer.h" | 5 #include "cc/layers/painted_overlay_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 thumb_length_(scrollbar_->ThumbLength()) { | 45 thumb_length_(scrollbar_->ThumbLength()) { |
| 46 DCHECK(scrollbar_->UsesNinePatchThumbResource()); | 46 DCHECK(scrollbar_->UsesNinePatchThumbResource()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() {} | 49 PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() {} |
| 50 | 50 |
| 51 int PaintedOverlayScrollbarLayer::ScrollLayerId() const { | 51 int PaintedOverlayScrollbarLayer::ScrollLayerId() const { |
| 52 return scroll_layer_id_; | 52 return scroll_layer_id_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void PaintedOverlayScrollbarLayer::SetScrollLayer(int layer_id) { |
| 56 if (layer_id == scroll_layer_id_) |
| 57 return; |
| 58 |
| 59 scroll_layer_id_ = layer_id; |
| 60 SetNeedsFullTreeSync(); |
| 61 } |
| 62 |
| 55 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 63 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 56 return scrollbar_->IsOverlay(); | 64 return scrollbar_->IsOverlay(); |
| 57 } | 65 } |
| 58 | 66 |
| 59 bool PaintedOverlayScrollbarLayer::AlwaysUseActiveTreeOpacity() const { | 67 bool PaintedOverlayScrollbarLayer::AlwaysUseActiveTreeOpacity() const { |
| 60 return true; | 68 return true; |
| 61 } | 69 } |
| 62 | 70 |
| 63 ScrollbarOrientation PaintedOverlayScrollbarLayer::orientation() const { | 71 ScrollbarOrientation PaintedOverlayScrollbarLayer::orientation() const { |
| 64 return scrollbar_->Orientation(); | 72 return scrollbar_->Orientation(); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 164 |
| 157 thumb_resource_ = ScopedUIResource::Create( | 165 thumb_resource_ = ScopedUIResource::Create( |
| 158 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); | 166 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); |
| 159 | 167 |
| 160 SetNeedsPushProperties(); | 168 SetNeedsPushProperties(); |
| 161 | 169 |
| 162 return true; | 170 return true; |
| 163 } | 171 } |
| 164 | 172 |
| 165 } // namespace cc | 173 } // namespace cc |
| OLD | NEW |