| 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();
|
| }
|
|
|
|
|