1 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 */ 8 #ifndef SkBenchTimer_DEFINED 9 #define SkBenchTimer_DEFINED 10 11 #include <SkTypes.h> 12 13 14 class BenchSysTimer; 15 class BenchGpuTimer; 16 17 class SkGLContext; 18 19 /** 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 */ 24 class BenchTimer { 25 public: 26 BenchTimer(SkGLContext* gl = NULL); 27 ~BenchTimer(); 28 void start(); 29 void end(); 30 double fCpu; 31 double fWall; 32 double fGpu; 33 34 private: 35 BenchSysTimer *fSysTimer; 36 BenchGpuTimer *fGpuTimer; 37 }; 38 39 #endif 40