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

Unified Diff: gpu/demos/app_framework/application.cc

Issue 551011: Changed the signature of Application::Draw to accept elapsed time. It will be... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « gpu/demos/app_framework/application.h ('k') | gpu/demos/hello_triangle/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/app_framework/application.cc
===================================================================
--- gpu/demos/app_framework/application.cc (revision 36127)
+++ gpu/demos/app_framework/application.cc (working copy)
@@ -74,7 +74,15 @@
}
void Application::OnPaint() {
- Draw();
+ float elapsed_sec = 0.0f;
+ const base::Time current_time = base::Time::Now();
+ if (!last_draw_time_.is_null()) {
+ base::TimeDelta time_delta = current_time - last_draw_time_;
+ elapsed_sec = static_cast<float>(time_delta.InSecondsF());
+ }
+ last_draw_time_ = current_time;
+
+ Draw(elapsed_sec);
gles2::GetGLContext()->SwapBuffers();
}
« no previous file with comments | « gpu/demos/app_framework/application.h ('k') | gpu/demos/hello_triangle/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698