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

Unified Diff: ui/compositor/compositor.h

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
Index: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 3c9ea047dcd33ccac94eb190f6fc014fd5d2c77a..d933040d53b47e27d57b8d2cf9d85ed28e7067e8 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -17,6 +17,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/compositor/compositor_export.h"
#include "ui/compositor/compositor_observer.h"
+#include "ui/compositor/layer_animator_collection.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
#include "ui/gfx/vector2d.h"
@@ -134,7 +135,8 @@ class COMPOSITOR_EXPORT CompositorLock
// view hierarchy.
class COMPOSITOR_EXPORT Compositor
: NON_EXPORTED_BASE(public cc::LayerTreeHostClient),
- NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) {
+ NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient),
+ NON_EXPORTED_BASE(public LayerAnimatorCollectionDelegate) {
public:
// This is deprecated, and will be removed shortly.
// TODO(sky): remove this.
@@ -224,7 +226,7 @@ class COMPOSITOR_EXPORT Compositor
// LayerTreeHostClient implementation.
virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
virtual void DidBeginMainFrame() OVERRIDE {}
- virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE {}
+ virtual void Animate(base::TimeTicks frame_begin_time) OVERRIDE;
virtual void Layout() OVERRIDE;
virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
float page_scale) OVERRIDE {}
@@ -242,6 +244,9 @@ class COMPOSITOR_EXPORT Compositor
virtual void DidPostSwapBuffers() OVERRIDE;
virtual void DidAbortSwapBuffers() OVERRIDE;
+ // LayerAnimatorCollectionDelegate implementation.
+ virtual void ScheduleAnimationForLayerCollection() OVERRIDE;
+
int last_started_frame() { return last_started_frame_; }
int last_ended_frame() { return last_ended_frame_; }
@@ -250,6 +255,10 @@ class COMPOSITOR_EXPORT Compositor
const cc::LayerTreeDebugState& GetLayerTreeDebugState() const;
void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state);
+ LayerAnimatorCollection* layer_animator_collection() {
+ return &layer_animator_collection_;
+ }
+
private:
friend class base::RefCounted<Compositor>;
friend class CompositorLock;
@@ -305,6 +314,8 @@ class COMPOSITOR_EXPORT Compositor
enum SwapState { SWAP_NONE, SWAP_POSTED, SWAP_COMPLETED };
SwapState swap_state_;
+ LayerAnimatorCollection layer_animator_collection_;
+
base::WeakPtrFactory<Compositor> schedule_draw_factory_;
DISALLOW_COPY_AND_ASSIGN(Compositor);

Powered by Google App Engine
This is Rietveld 408576698