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

Unified Diff: tools/VisualBench.h

Issue 1159213002: Expand VisualBench to a real benching tool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/views/unix/SkOSWindow_Unix.cpp ('k') | tools/VisualBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench.h
diff --git a/tools/VisualBench.h b/tools/VisualBench.h
index d9e0b508669c34ad799f9b8e5adf49495cdb0319..13fc85c6b8473ca9096addfe47f530aa84ab2ce6 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;
« no previous file with comments | « src/views/unix/SkOSWindow_Unix.cpp ('k') | tools/VisualBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698