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

Unified Diff: examples/ganesh_app/ganesh_view.h

Issue 731893002: Add a simple scheduler for animation frames (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix math Created 6 years, 1 month 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 | « examples/ganesh_app/DEPS ('k') | examples/ganesh_app/ganesh_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ganesh_app/ganesh_view.h
diff --git a/examples/ganesh_app/ganesh_view.h b/examples/ganesh_app/ganesh_view.h
index 8b7e847ac96a505f815723f87ffdff66c2252ad9..505f6965744ed494ec0a08ef37411d577a71ac6f 100644
--- a/examples/ganesh_app/ganesh_view.h
+++ b/examples/ganesh_app/ganesh_view.h
@@ -8,6 +8,7 @@
#include "examples/ganesh_app/ganesh_context.h"
#include "examples/ganesh_app/mojo_gl_context.h"
#include "examples/ganesh_app/texture_uploader.h"
+#include "mc/scheduler/scheduler.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
@@ -17,25 +18,35 @@ class Shell;
namespace examples {
-class GaneshView : public TextureUploader::Client, public mojo::ViewObserver {
+class GaneshView : public TextureUploader::Client,
+ public mc::Scheduler::Client,
+ public mojo::ViewObserver {
public:
GaneshView(mojo::Shell* shell, mojo::View* view);
~GaneshView();
private:
+ // From ViewObserver
void OnViewDestroyed(mojo::View* view) override;
void OnViewBoundsChanged(mojo::View* view,
const mojo::Rect& old_bounds,
const mojo::Rect& new_bounds) override;
+ // From TextureUploader::Client
void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override;
- void Draw(const mojo::Size& size);
+ // From mc::Scheduler::Client
+ void BeginFrame(base::TimeTicks frame_time,
+ base::TimeTicks deadline) override;
+
+ base::TimeDelta Draw(base::TimeTicks frame_time);
mojo::View* view_;
MojoGLContext gl_context_;
GaneshContext gr_context_;
TextureUploader texture_uploader_;
+ base::TimeTicks base_time_;
+ mc::Scheduler scheduler_;
DISALLOW_COPY_AND_ASSIGN(GaneshView);
};
« no previous file with comments | « examples/ganesh_app/DEPS ('k') | examples/ganesh_app/ganesh_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698