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

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

Issue 1297363004: cc: Move animate steps from proxies to LayerTreeHostImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moveanimatecodetolthi: . Created 5 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | 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/thread_proxy.h" 5 #include "cc/trees/thread_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 impl().last_begin_main_frame_args; 844 impl().last_begin_main_frame_args;
845 } 845 }
846 impl().layer_tree_host_impl->BeginMainFrameAborted(reason); 846 impl().layer_tree_host_impl->BeginMainFrameAborted(reason);
847 impl().scheduler->BeginMainFrameAborted(reason); 847 impl().scheduler->BeginMainFrameAborted(reason);
848 } 848 }
849 849
850 void ThreadProxy::ScheduledActionAnimate() { 850 void ThreadProxy::ScheduledActionAnimate() {
851 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); 851 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate");
852 DCHECK(IsImplThread()); 852 DCHECK(IsImplThread());
853 853
854 // Don't animate if there is no root layer. 854 impl().layer_tree_host_impl->Animate();
855 // TODO(mithro): Both Animate and UpdateAnimationState already have a
856 // "!active_tree_->root_layer()" check?
857 if (!impl().layer_tree_host_impl->active_tree()->root_layer()) {
858 return;
859 }
860
861 impl().animation_time =
862 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time;
863 impl().layer_tree_host_impl->Animate(impl().animation_time);
864
865 // If animations are not visible, update the state now as
866 // ScheduledActionDrawAndSwapIfPossible will never be called.
867 if (!impl().layer_tree_host_impl->AnimationsAreVisible()) {
868 impl().layer_tree_host_impl->UpdateAnimationState(true);
869 }
870 } 855 }
871 856
872 void ThreadProxy::ScheduledActionCommit() { 857 void ThreadProxy::ScheduledActionCommit() {
873 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); 858 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit");
874 DCHECK(IsImplThread()); 859 DCHECK(IsImplThread());
875 DCHECK(IsMainThreadBlocked()); 860 DCHECK(IsMainThreadBlocked());
876 DCHECK(impl().commit_completion_event); 861 DCHECK(impl().commit_completion_event);
877 862
878 blocked_main().main_thread_inside_commit = true; 863 blocked_main().main_thread_inside_commit = true;
879 impl().layer_tree_host_impl->BeginCommit(); 864 impl().layer_tree_host_impl->BeginCommit();
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 1247
1263 void ThreadProxy::PostFrameTimingEvents( 1248 void ThreadProxy::PostFrameTimingEvents(
1264 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, 1249 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
1265 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { 1250 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
1266 DCHECK(IsMainThread()); 1251 DCHECK(IsMainThread());
1267 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), 1252 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(),
1268 main_frame_events.Pass()); 1253 main_frame_events.Pass());
1269 } 1254 }
1270 1255
1271 } // namespace cc 1256 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698