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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 DCHECK(scrollbar_->UsesNinePatchThumbResource()); | 47 DCHECK(scrollbar_->UsesNinePatchThumbResource()); |
48 } | 48 } |
49 | 49 |
50 PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() {} | 50 PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() {} |
51 | 51 |
52 ElementId PaintedOverlayScrollbarLayer::scroll_element_id() const { | 52 ElementId PaintedOverlayScrollbarLayer::scroll_element_id() const { |
53 return scroll_element_id_; | 53 return scroll_element_id_; |
54 } | 54 } |
55 | 55 |
56 void PaintedOverlayScrollbarLayer::SetScrollElementId(ElementId element_id) { | 56 void PaintedOverlayScrollbarLayer::SetScrollElementId(ElementId element_id) { |
57 if (element_id == scroll_element_id_) | 57 if (element_id.id == scroll_element_id_.id) |
wkorman
2017/05/08 18:23:24
Can't we rely on operator== here?
| |
58 return; | 58 return; |
59 | 59 |
60 scroll_element_id_ = element_id; | 60 scroll_element_id_ = element_id; |
61 SetNeedsFullTreeSync(); | 61 SetNeedsFullTreeSync(); |
62 } | 62 } |
63 | 63 |
64 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { | 64 bool PaintedOverlayScrollbarLayer::OpacityCanAnimateOnImplThread() const { |
65 return scrollbar_->IsOverlay(); | 65 return scrollbar_->IsOverlay(); |
66 } | 66 } |
67 | 67 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 | 165 |
166 thumb_resource_ = ScopedUIResource::Create( | 166 thumb_resource_ = ScopedUIResource::Create( |
167 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); | 167 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); |
168 | 168 |
169 SetNeedsPushProperties(); | 169 SetNeedsPushProperties(); |
170 | 170 |
171 return true; | 171 return true; |
172 } | 172 } |
173 | 173 |
174 } // namespace cc | 174 } // namespace cc |
OLD | NEW |