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

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

Issue 571873003: [Android]Optimization of scrollbar animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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/layer_tree_impl.h" 8 #include "cc/trees/layer_tree_impl.h"
9 #include "ui/gfx/rect_conversions.h" 9 #include "ui/gfx/rect_conversions.h"
10 10
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 return ScrollbarLayerRectToContentRect(thumb_rect); 242 return ScrollbarLayerRectToContentRect(thumb_rect);
243 } 243 }
244 244
245 void ScrollbarLayerImplBase::ScrollbarParametersDidChange() { 245 void ScrollbarLayerImplBase::ScrollbarParametersDidChange() {
246 if (!clip_layer_ || !scroll_layer_) 246 if (!clip_layer_ || !scroll_layer_)
247 return; 247 return;
248 248
249 scroll_layer_->SetScrollbarPosition(this, clip_layer_); 249 scroll_layer_->SetScrollbarPosition(this, clip_layer_);
250 } 250 }
251 251
252 bool ScrollbarLayerImplBase::ScrollbarNeedsUpdate(
253 float vertical_adjust,
254 float current_pos,
255 int maximum,
256 float visible_to_total_length_ratio) {
257 if ((vertical_adjust != vertical_adjust_) || (current_pos != current_pos_) ||
258 (maximum != maximum_) ||
259 (visible_to_total_length_ratio != visible_to_total_length_ratio_))
260 return true;
261 return false;
262 }
263
252 } // namespace cc 264 } // namespace cc
OLDNEW
« cc/layers/scrollbar_layer_impl_base.h ('K') | « cc/layers/scrollbar_layer_impl_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698