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

Unified Diff: gpu/demos/framework/demo.cc

Issue 554053: Added infrastructure to run gpu demos under Pepper3D. Created a Demo class th... (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/framework/demo.h ('k') | gpu/demos/framework/demo_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/framework/demo.cc
===================================================================
--- gpu/demos/framework/demo.cc (revision 0)
+++ gpu/demos/framework/demo.cc (revision 0)
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/demos/framework/demo.h"
+#include "gpu/demos/framework/demo_factory.h"
+
+namespace gpu {
+namespace demos {
+
+Demo::Demo() : width_(0), height_(0) {
+}
+
+Demo::~Demo() {
+}
+
+void Demo::InitWindowSize(int width, int height) {
+ width_ = width;
+ height_ = height;
+}
+
+void Demo::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;
+
+ Render(elapsed_sec);
+}
+
+} // namespace demos
+} // namespace gpu
Property changes on: gpu\demos\framework\demo.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « gpu/demos/framework/demo.h ('k') | gpu/demos/framework/demo_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698