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

Unified Diff: ui/compositor/compositor.cc

Issue 291843012: compositor: Tick the UI animations from cc, instead of from timer callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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 | « ui/compositor/compositor.h ('k') | ui/compositor/compositor.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 7a1b2928a8890ac7d73b46511fa8191782788865..c62c12658474987e43abb35f9c9fa46c08549211 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -26,6 +26,7 @@
#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor/layer.h"
+#include "ui/compositor/layer_animator_collection.h"
#include "ui/gfx/frame_time.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_switches.h"
@@ -257,7 +258,9 @@ void Compositor::Draw() {
// TODO(nduca): Temporary while compositor calls
// compositeImmediately() directly.
Layout();
- host_->Composite(gfx::FrameTime::Now());
+ base::TimeTicks now = gfx::FrameTime::Now();
+ Animate(now);
piman 2014/05/23 18:20:06 I'm not sure I understand what in the animation co
sadrul 2014/05/23 18:32:28 I am not sure if there is anything to ensure this
ajuma 2014/05/23 19:15:14 There doesn't seem to be anything to ensure this.
+ host_->Composite(now);
}
if (swap_state_ == SWAP_NONE)
NotifyEnd();
@@ -317,6 +320,12 @@ bool Compositor::HasObserver(CompositorObserver* observer) {
return observer_list_.HasObserver(observer);
}
+void Compositor::Animate(base::TimeTicks frame_begin_time) {
+ LayerAnimatorCollection::GetInstance()->Progress(frame_begin_time);
piman 2014/05/23 18:20:06 We have one compositor per root window, which are
sadrul 2014/05/23 18:32:28 Ah, good point. Right now, the LayerAnimator does
ajuma 2014/05/23 19:15:14 Maybe LayerAnimationDelegate::GetCollection(), whe
+ if (LayerAnimatorCollection::GetInstance()->HasActiveAnimators())
+ host_->SetNeedsAnimate();
+}
+
void Compositor::Layout() {
// We're sending damage that will be addressed during this composite
// cycle, so we don't need to schedule another composite to address it.
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/compositor.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698