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

Unified Diff: trunk/src/cc/trees/thread_proxy.cc

Issue 254883004: Revert 266624 "cc: Split animating and drawing into separate act..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/cc/trees/thread_proxy.h ('k') | trunk/src/content/renderer/input/input_handler_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/trees/thread_proxy.cc
===================================================================
--- trunk/src/cc/trees/thread_proxy.cc (revision 266894)
+++ trunk/src/cc/trees/thread_proxy.cc (working copy)
@@ -125,10 +125,8 @@
inside_draw(false),
input_throttled_until_commit(false),
animations_frozen_until_next_draw(false),
- did_commit_after_animating(false),
renew_tree_priority_pending(false),
- weak_factory(proxy) {
-}
+ weak_factory(proxy) {}
ThreadProxy::CompositorThreadOnly::~CompositorThreadOnly() {}
@@ -565,12 +563,6 @@
impl().scheduler->SetNeedsRedraw();
}
-void ThreadProxy::SetNeedsAnimateOnImplThread() {
- TRACE_EVENT0("cc", "ThreadProxy::SetNeedsAnimateOnImplThread");
- DCHECK(IsImplThread());
- impl().scheduler->SetNeedsAnimate();
-}
-
void ThreadProxy::SetNeedsManageTilesOnImplThread() {
DCHECK(IsImplThread());
impl().scheduler->SetNeedsManageTiles();
@@ -1028,18 +1020,6 @@
impl().scheduler->BeginMainFrameAborted(did_handle);
}
-void ThreadProxy::ScheduledActionAnimate() {
- TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate");
- DCHECK(IsImplThread());
-
- if (!impl().animations_frozen_until_next_draw) {
- impl().animation_time =
- impl().layer_tree_host_impl->CurrentFrameTimeTicks();
- }
- impl().layer_tree_host_impl->Animate(impl().animation_time);
- impl().did_commit_after_animating = false;
-}
-
void ThreadProxy::ScheduledActionCommit() {
TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit");
DCHECK(IsImplThread());
@@ -1052,10 +1032,10 @@
impl().current_resource_update_controller.reset();
if (impl().animations_frozen_until_next_draw) {
- impl().animation_time = std::max(
- impl().animation_time, blocked_main().last_monotonic_frame_begin_time);
+ impl().animation_freeze_time =
+ std::max(impl().animation_freeze_time,
+ blocked_main().last_monotonic_frame_begin_time);
}
- impl().did_commit_after_animating = true;
blocked_main().main_thread_inside_commit = true;
impl().layer_tree_host_impl->BeginCommit();
@@ -1129,13 +1109,17 @@
base::TimeDelta draw_duration_estimate = DrawDurationEstimate();
base::AutoReset<bool> mark_inside(&impl().inside_draw, true);
- if (impl().did_commit_after_animating) {
- impl().layer_tree_host_impl->Animate(impl().animation_time);
- impl().did_commit_after_animating = false;
- }
+ // Advance our animations.
+ base::TimeTicks monotonic_time;
+ if (impl().animations_frozen_until_next_draw)
+ monotonic_time = impl().animation_freeze_time;
+ else
+ monotonic_time = impl().layer_tree_host_impl->CurrentFrameTimeTicks();
+ // TODO(enne): This should probably happen post-animate.
if (impl().layer_tree_host_impl->pending_tree())
impl().layer_tree_host_impl->pending_tree()->UpdateDrawProperties();
+ impl().layer_tree_host_impl->Animate(monotonic_time);
// This method is called on a forced draw, regardless of whether we are able
// to produce a frame, as the calling site on main thread is blocked until its
@@ -1189,6 +1173,7 @@
// checkerboarding will be displayed when we force a draw. To avoid this,
// we freeze animations until we successfully draw.
impl().animations_frozen_until_next_draw = true;
+ impl().animation_freeze_time = monotonic_time;
} else {
DCHECK_NE(DrawSwapReadbackResult::DRAW_SUCCESS, result.draw_result);
}
« no previous file with comments | « trunk/src/cc/trees/thread_proxy.h ('k') | trunk/src/content/renderer/input/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698