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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/demos/framework/demo.h ('k') | gpu/demos/framework/demo_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gpu/demos/framework/demo.h"
6 #include "gpu/demos/framework/demo_factory.h"
7
8 namespace gpu {
9 namespace demos {
10
11 Demo::Demo() : width_(0), height_(0) {
12 }
13
14 Demo::~Demo() {
15 }
16
17 void Demo::InitWindowSize(int width, int height) {
18 width_ = width;
19 height_ = height;
20 }
21
22 void Demo::Draw() {
23 float elapsed_sec = 0.0f;
24 const base::Time current_time = base::Time::Now();
25 if (!last_draw_time_.is_null()) {
26 base::TimeDelta time_delta = current_time - last_draw_time_;
27 elapsed_sec = static_cast<float>(time_delta.InSecondsF());
28 }
29 last_draw_time_ = current_time;
30
31 Render(elapsed_sec);
32 }
33
34 } // namespace demos
35 } // namespace gpu
OLDNEW
« 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