Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: cc/layers/scrollbar_layer_impl_base.cc

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments, pull element_id.h change to another patch Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/layers/scrollbar_layer_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/scrollbar_layer_impl_base.h" 5 #include "cc/layers/scrollbar_layer_impl_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "cc/trees/effect_node.h" 8 #include "cc/trees/effect_node.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 #include "ui/gfx/geometry/rect_conversions.h" 10 #include "ui/gfx/geometry/rect_conversions.h"
(...skipping 18 matching lines...) Expand all
29 vertical_adjust_(0.f) {} 29 vertical_adjust_(0.f) {}
30 30
31 ScrollbarLayerImplBase::~ScrollbarLayerImplBase() { 31 ScrollbarLayerImplBase::~ScrollbarLayerImplBase() {
32 layer_tree_impl()->UnregisterScrollbar(this); 32 layer_tree_impl()->UnregisterScrollbar(this);
33 } 33 }
34 34
35 void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) { 35 void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) {
36 LayerImpl::PushPropertiesTo(layer); 36 LayerImpl::PushPropertiesTo(layer);
37 DCHECK(layer->ToScrollbarLayer()); 37 DCHECK(layer->ToScrollbarLayer());
38 layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_); 38 layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_);
39 layer->ToScrollbarLayer()->SetScrollLayerId(ScrollLayerId()); 39 layer->ToScrollbarLayer()->SetScrollInfo(ScrollLayerId(),
40 scroll_element_id());
40 } 41 }
41 42
42 ScrollbarLayerImplBase* ScrollbarLayerImplBase::ToScrollbarLayer() { 43 ScrollbarLayerImplBase* ScrollbarLayerImplBase::ToScrollbarLayer() {
43 return this; 44 return this;
44 } 45 }
45 46
46 void ScrollbarLayerImplBase::SetScrollLayerId(int scroll_layer_id) { 47 void ScrollbarLayerImplBase::SetScrollInfo(int scroll_layer_id,
47 if (scroll_layer_id_ == scroll_layer_id) 48 ElementId scroll_element_id) {
49 if (scroll_layer_id_ == scroll_layer_id &&
50 scroll_element_id == scroll_element_id)
pdr. 2017/04/20 02:53:42 Oops, "scroll_element_id == scroll_element_id" ins
48 return; 51 return;
49 52
50 layer_tree_impl()->UnregisterScrollbar(this); 53 layer_tree_impl()->UnregisterScrollbar(this);
51 54
52 scroll_layer_id_ = scroll_layer_id; 55 scroll_layer_id_ = scroll_layer_id;
56 scroll_element_id_ = scroll_element_id;
53 57
54 layer_tree_impl()->RegisterScrollbar(this); 58 layer_tree_impl()->RegisterScrollbar(this);
55 } 59 }
56 60
57 bool ScrollbarLayerImplBase::SetCurrentPos(float current_pos) { 61 bool ScrollbarLayerImplBase::SetCurrentPos(float current_pos) {
58 if (current_pos_ == current_pos) 62 if (current_pos_ == current_pos)
59 return false; 63 return false;
60 current_pos_ = current_pos; 64 current_pos_ = current_pos;
61 NoteLayerPropertyChanged(); 65 NoteLayerPropertyChanged();
62 return true; 66 return true;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 layer_tree_impl()->AddToOpacityAnimationsMap(id(), opacity); 230 layer_tree_impl()->AddToOpacityAnimationsMap(id(), opacity);
227 231
228 node->opacity = opacity; 232 node->opacity = opacity;
229 node->effect_changed = true; 233 node->effect_changed = true;
230 property_trees->changed = true; 234 property_trees->changed = true;
231 property_trees->effect_tree.set_needs_update(true); 235 property_trees->effect_tree.set_needs_update(true);
232 layer_tree_impl()->set_needs_update_draw_properties(); 236 layer_tree_impl()->set_needs_update_draw_properties();
233 } 237 }
234 238
235 } // namespace cc 239 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/layers/scrollbar_layer_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698