| 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 |  | 
| 63 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 55 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 
| 64   return scrollbar_->IsOverlay(); | 56   return scrollbar_->IsOverlay(); | 
| 65 } | 57 } | 
| 66 | 58 | 
| 67 bool PaintedOverlayScrollbarLayer::AlwaysUseActiveTreeOpacity() const { | 59 bool PaintedOverlayScrollbarLayer::AlwaysUseActiveTreeOpacity() const { | 
| 68   return true; | 60   return true; | 
| 69 } | 61 } | 
| 70 | 62 | 
| 71 ScrollbarOrientation PaintedOverlayScrollbarLayer::orientation() const { | 63 ScrollbarOrientation PaintedOverlayScrollbarLayer::orientation() const { | 
| 72   return scrollbar_->Orientation(); | 64   return scrollbar_->Orientation(); | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 164 | 156 | 
| 165   thumb_resource_ = ScopedUIResource::Create( | 157   thumb_resource_ = ScopedUIResource::Create( | 
| 166       layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); | 158       layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); | 
| 167 | 159 | 
| 168   SetNeedsPushProperties(); | 160   SetNeedsPushProperties(); | 
| 169 | 161 | 
| 170   return true; | 162   return true; | 
| 171 } | 163 } | 
| 172 | 164 | 
| 173 }  // namespace cc | 165 }  // namespace cc | 
| OLD | NEW | 
|---|