blob: 080bc6db10f6d3feb6d2618e0e7ddeae066d5788 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
bungeman@google.combe9ad4e2011-06-07 19:16:02 +00008#ifndef SkBenchTimer_DEFINED
9#define SkBenchTimer_DEFINED
10
bsalomon@google.com373a6632011-10-19 20:43:20 +000011#include <SkTypes.h>
12
13
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000014class BenchSysTimer;
15class BenchGpuTimer;
16
bsalomon@google.com373a6632011-10-19 20:43:20 +000017class SkGLContext;
18
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000019/**
20 * SysTimers and GpuTimers are implemented orthogonally.
21 * This class combines a SysTimer and a GpuTimer into one single,
22 * platform specific, Timer with a simple interface.
23 */
24class BenchTimer {
25public:
bsalomon@google.com373a6632011-10-19 20:43:20 +000026 BenchTimer(SkGLContext* gl = NULL);
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000027 ~BenchTimer();
28 void start();
29 void end();
30 double fCpu;
31 double fWall;
32 double fGpu;
33
34private:
35 BenchSysTimer *fSysTimer;
36 BenchGpuTimer *fGpuTimer;
37};
38
39#endif