| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return; | 63 return; |
| 64 | 64 |
| 65 scroll_layer_id_ = layer_id; | 65 scroll_layer_id_ = layer_id; |
| 66 SetNeedsFullTreeSync(); | 66 SetNeedsFullTreeSync(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 69 bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
| 70 return scrollbar_->IsOverlay(); | 70 return scrollbar_->IsOverlay(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool PaintedScrollbarLayer::AlwaysUseActiveTreeOpacity() const { |
| 74 return true; |
| 75 } |
| 76 |
| 73 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { | 77 ScrollbarOrientation PaintedScrollbarLayer::orientation() const { |
| 74 return scrollbar_->Orientation(); | 78 return scrollbar_->Orientation(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 int PaintedScrollbarLayer::MaxTextureSize() { | 81 int PaintedScrollbarLayer::MaxTextureSize() { |
| 78 DCHECK(layer_tree_host()); | 82 DCHECK(layer_tree_host()); |
| 79 return layer_tree_host()->GetRendererCapabilities().max_texture_size; | 83 return layer_tree_host()->GetRendererCapabilities().max_texture_size; |
| 80 } | 84 } |
| 81 | 85 |
| 82 float PaintedScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { | 86 float PaintedScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 304 |
| 301 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 305 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
| 302 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 306 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
| 303 // allocation and copying. | 307 // allocation and copying. |
| 304 skbitmap.setImmutable(); | 308 skbitmap.setImmutable(); |
| 305 | 309 |
| 306 return UIResourceBitmap(skbitmap); | 310 return UIResourceBitmap(skbitmap); |
| 307 } | 311 } |
| 308 | 312 |
| 309 } // namespace cc | 313 } // namespace cc |
| OLD | NEW |