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

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

Issue 461083002: Force a commit at the end of the top controls animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment cleanup Created 6 years, 4 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 | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('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 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_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after
3027 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { 3027 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) {
3028 if (!top_controls_manager_ || !top_controls_manager_->animation()) 3028 if (!top_controls_manager_ || !top_controls_manager_->animation())
3029 return; 3029 return;
3030 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); 3030 gfx::Vector2dF scroll = top_controls_manager_->Animate(time);
3031 if (active_tree_->TotalScrollOffset().y() == 0.f) 3031 if (active_tree_->TotalScrollOffset().y() == 0.f)
3032 return; 3032 return;
3033 if (!scroll.IsZero()) { 3033 if (!scroll.IsZero()) {
3034 ScrollViewportBy(gfx::ScaleVector2d( 3034 ScrollViewportBy(gfx::ScaleVector2d(
3035 scroll, 1.f / active_tree_->total_page_scale_factor())); 3035 scroll, 1.f / active_tree_->total_page_scale_factor()));
3036 SetNeedsRedraw(); 3036 SetNeedsRedraw();
3037 client_->SetNeedsCommitOnImplThread();
3038 client_->RenewTreePriority();
3037 } 3039 }
3038 SetNeedsAnimate(); 3040 if (top_controls_manager_->animation())
3041 SetNeedsAnimate();
aelias_OOO_until_Jul13 2014/08/12 20:38:09 Now that I look at this, this SetNeedsAnimate shou
jdduke (slow) 2014/08/12 22:48:50 Done.
3039 } 3042 }
3040 3043
3041 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { 3044 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
3042 if (!settings_.accelerated_animation_enabled || 3045 if (!settings_.accelerated_animation_enabled ||
3043 !needs_animate_layers() || 3046 !needs_animate_layers() ||
3044 !active_tree_->root_layer()) 3047 !active_tree_->root_layer())
3045 return; 3048 return;
3046 3049
3047 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); 3050 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers");
3048 AnimationRegistrar::AnimationControllerMap copy = 3051 AnimationRegistrar::AnimationControllerMap copy =
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
3369 } 3372 }
3370 3373
3371 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3374 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3372 std::vector<PictureLayerImpl*>::iterator it = 3375 std::vector<PictureLayerImpl*>::iterator it =
3373 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3376 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3374 DCHECK(it != picture_layers_.end()); 3377 DCHECK(it != picture_layers_.end());
3375 picture_layers_.erase(it); 3378 picture_layers_.erase(it);
3376 } 3379 }
3377 3380
3378 } // namespace cc 3381 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698