diff options
author | 2015-06-01 10:03:54 -0700 | |
---|---|---|
committer | 2015-06-01 10:03:55 -0700 | |
commit | 7fe8ee4cb7396754bfdb8c3bc1bf7c09af7459dd (patch) | |
tree | 52560e70e7de11398f7d39767468e2eb7a44d053 /tools/VisualBench.h | |
parent | 038b01c081d16e3e3ec3e874c816ee866ab73508 (diff) |
Expand VisualBench to a real benching tool
BUG=skia:
Review URL: https://codereview.chromium.org/1159213002
Diffstat (limited to 'tools/VisualBench.h')
-rw-r--r-- | tools/VisualBench.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/VisualBench.h b/tools/VisualBench.h index d9e0b50866..13fc85c6b8 100644 --- a/tools/VisualBench.h +++ b/tools/VisualBench.h @@ -13,6 +13,7 @@ #include "SkPicture.h" #include "SkSurface.h" +#include "Timer.h" #include "gl/SkGLContext.h" class GrContext; @@ -38,13 +39,30 @@ protected: private: void setTitle(); bool setupBackend(); + void resetContext(); void setupRenderTarget(); bool onHandleChar(SkUnichar unichar) override; + void printStats(); + inline void timePicture(SkCanvas*); + inline void renderFrame(SkCanvas*); - int fCurrentLoops; + struct Timing { + SkString fName; + SkTArray<double> fMeasurements; + }; + + enum State { + kPreWarm_State, + kTiming_State, + }; + + int fLoop; int fCurrentPicture; - int fCurrentFrame; + int fCurrentSample; + SkTArray<Timing> fTimings; SkTArray<SkPicture*> fPictures; + WallTimer fTimer; + State fState; // support framework SkAutoTUnref<SkSurface> fSurface; |