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

Side by Side Diff: bench/BenchTimer.h

Issue 16069010: extend SkBenchmark to allow a bench to return a durationScale, which allows it to perform fewer act… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | « no previous file | bench/BenchTimer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkBenchTimer_DEFINED 8 #ifndef SkBenchTimer_DEFINED
9 #define SkBenchTimer_DEFINED 9 #define SkBenchTimer_DEFINED
10 10
(...skipping 11 matching lines...) Expand all
22 * platform specific Timer with a simple interface. The truncated 22 * platform specific Timer with a simple interface. The truncated
23 * timer doesn't include the time required for the GPU to finish 23 * timer doesn't include the time required for the GPU to finish
24 * its rendering. It should always be <= the un-truncated system 24 * its rendering. It should always be <= the un-truncated system
25 * times and (for GPU configurations) can be used to roughly (very 25 * times and (for GPU configurations) can be used to roughly (very
26 * roughly) gauge the GPU load/backlog. 26 * roughly) gauge the GPU load/backlog.
27 */ 27 */
28 class BenchTimer { 28 class BenchTimer {
29 public: 29 public:
30 BenchTimer(SkGLContextHelper* gl = NULL); 30 BenchTimer(SkGLContextHelper* gl = NULL);
31 ~BenchTimer(); 31 ~BenchTimer();
32 void start(); 32 void start(double durationScale = 1);
33 void end(); 33 void end();
34 void truncatedEnd(); 34 void truncatedEnd();
35 double fCpu; 35 double fCpu;
36 double fWall; 36 double fWall;
37 double fTruncatedCpu; 37 double fTruncatedCpu;
38 double fTruncatedWall; 38 double fTruncatedWall;
39 double fGpu; 39 double fGpu;
40 40
41 private: 41 private:
42 BenchSysTimer *fSysTimer; 42 BenchSysTimer *fSysTimer;
43 BenchSysTimer *fTruncatedSysTimer; 43 BenchSysTimer *fTruncatedSysTimer;
44 #if SK_SUPPORT_GPU 44 #if SK_SUPPORT_GPU
45 BenchGpuTimer *fGpuTimer; 45 BenchGpuTimer *fGpuTimer;
46 #endif 46 #endif
47 double fDurationScale; // for this start/end session
47 }; 48 };
48 49
49 #endif 50 #endif
OLDNEW
« no previous file with comments | « no previous file | bench/BenchTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698