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

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

Issue 167013003: cc: Don't schedule top controls animation when there isn't one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mismatch smismatch Created 6 years, 10 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 | Annotate | Revision Log
« 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 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 SetNeedsRedraw(); 2626 SetNeedsRedraw();
2627 2627
2628 if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) { 2628 if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) {
2629 page_scale_animation_.reset(); 2629 page_scale_animation_.reset();
2630 client_->SetNeedsCommitOnImplThread(); 2630 client_->SetNeedsCommitOnImplThread();
2631 client_->RenewTreePriority(); 2631 client_->RenewTreePriority();
2632 } 2632 }
2633 } 2633 }
2634 2634
2635 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { 2635 void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) {
2636 if (!top_controls_manager_) 2636 if (!top_controls_manager_ || !top_controls_manager_->animation())
2637 return; 2637 return;
2638 gfx::Vector2dF scroll = top_controls_manager_->Animate(time); 2638 gfx::Vector2dF scroll = top_controls_manager_->Animate(time);
2639 if (active_tree_->TotalScrollOffset().y() == 0.f) 2639 if (active_tree_->TotalScrollOffset().y() == 0.f)
2640 return; 2640 return;
2641 if (scroll.IsZero()) { 2641 if (scroll.IsZero()) {
2642 // This may happen on the first animation step. Force redraw otherwise 2642 // This may happen on the first animation step. Force redraw otherwise
2643 // the animation would stop because of no new frames. 2643 // the animation would stop because of no new frames.
2644 SetNeedsRedraw(); 2644 SetNeedsRedraw();
2645 } else { 2645 } else {
2646 ScrollViewportBy(gfx::ScaleVector2d( 2646 ScrollViewportBy(gfx::ScaleVector2d(
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 swap_promise_monitor_.erase(monitor); 2998 swap_promise_monitor_.erase(monitor);
2999 } 2999 }
3000 3000
3001 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3001 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3002 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3002 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3003 for (; it != swap_promise_monitor_.end(); it++) 3003 for (; it != swap_promise_monitor_.end(); it++)
3004 (*it)->OnSetNeedsRedrawOnImpl(); 3004 (*it)->OnSetNeedsRedrawOnImpl();
3005 } 3005 }
3006 3006
3007 } // namespace cc 3007 } // 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