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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 1418493003: Let LayerTreeHostImpl::ScrollAnimated scroll the outer viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 ? OuterViewportScrollLayer()->scroll_clip_layer() 358 ? OuterViewportScrollLayer()->scroll_clip_layer()
359 : NULL; 359 : NULL;
360 } 360 }
361 361
362 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { 362 LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const {
363 DCHECK(IsActiveTree()); 363 DCHECK(IsActiveTree());
364 return LayerById(currently_scrolling_layer_id_); 364 return LayerById(currently_scrolling_layer_id_);
365 } 365 }
366 366
367 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { 367 void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) {
368 DCHECK_IMPLIES(layer, layer != OuterViewportScrollLayer());
369
370 int new_id = layer ? layer->id() : Layer::INVALID_ID; 368 int new_id = layer ? layer->id() : Layer::INVALID_ID;
371 if (currently_scrolling_layer_id_ == new_id) 369 if (currently_scrolling_layer_id_ == new_id)
372 return; 370 return;
373 371
374 ScrollbarAnimationController* old_animation_controller = 372 ScrollbarAnimationController* old_animation_controller =
375 layer_tree_host_impl_->ScrollbarAnimationControllerForId( 373 layer_tree_host_impl_->ScrollbarAnimationControllerForId(
376 currently_scrolling_layer_id_); 374 currently_scrolling_layer_id_);
377 ScrollbarAnimationController* new_animation_controller = 375 ScrollbarAnimationController* new_animation_controller =
378 layer_tree_host_impl_->ScrollbarAnimationControllerForId(new_id); 376 layer_tree_host_impl_->ScrollbarAnimationControllerForId(new_id);
379 377
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 const gfx::BoxF& box, 1891 const gfx::BoxF& box,
1894 gfx::BoxF* bounds) const { 1892 gfx::BoxF* bounds) const {
1895 *bounds = gfx::BoxF(); 1893 *bounds = gfx::BoxF();
1896 return layer_tree_host_impl_->animation_host() 1894 return layer_tree_host_impl_->animation_host()
1897 ? layer_tree_host_impl_->animation_host() 1895 ? layer_tree_host_impl_->animation_host()
1898 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 1896 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1899 : true; 1897 : true;
1900 } 1898 }
1901 1899
1902 } // namespace cc 1900 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698