Index: tools/VisualBench/VisualLightweightBenchModule.h |
diff --git a/tools/VisualBench/VisualBench.h b/tools/VisualBench/VisualLightweightBenchModule.h |
similarity index 79% |
copy from tools/VisualBench/VisualBench.h |
copy to tools/VisualBench/VisualLightweightBenchModule.h |
index 61002fc9e9355d412fc9a0e9b61036a8947583aa..64b4a11c0e0c1f5fa0b944940f60d1246b21d750 100644 |
--- a/tools/VisualBench/VisualBench.h |
+++ b/tools/VisualBench/VisualLightweightBenchModule.h |
@@ -6,39 +6,29 @@ |
* |
*/ |
-#ifndef VisualBench_DEFINED |
-#define VisualBench_DEFINED |
+#ifndef VisualLightweightBenchModule_DEFINED |
+#define VisualLightweightBenchModule_DEFINED |
-#include "SkWindow.h" |
+#include "VisualModule.h" |
#include "ResultsWriter.h" |
#include "SkPicture.h" |
-#include "SkString.h" |
-#include "SkSurface.h" |
#include "Timer.h" |
+#include "VisualBench.h" |
#include "VisualBenchmarkStream.h" |
-#include "gl/SkGLContext.h" |
-class GrContext; |
-struct GrGLInterface; |
-class GrRenderTarget; |
class SkCanvas; |
/* |
- * A Visual benchmarking tool for gpu benchmarking |
+ * This module is designed to be a minimal overhead timing module for VisualBench |
*/ |
-class VisualBench : public SkOSWindow { |
+class VisualLightweightBenchModule : public VisualModule { |
public: |
- VisualBench(void* hwnd, int argc, char** argv); |
- ~VisualBench() override; |
- |
-protected: |
- SkSurface* createSurface() override; |
+ // TODO get rid of backpointer |
+ VisualLightweightBenchModule(VisualBench* owner); |
void draw(SkCanvas* canvas) override; |
- void onSizeChange() override; |
- |
private: |
/* |
* The heart of visual bench is an event driven timing loop. |
@@ -70,9 +60,7 @@ private: |
}; |
void setTitle(); |
bool setupBackend(); |
- void resetContext(); |
void setupRenderTarget(); |
- bool onHandleChar(SkUnichar unichar) override; |
void printStats(); |
bool advanceRecordIfNecessary(SkCanvas*); |
inline void renderFrame(SkCanvas*); |
@@ -101,14 +89,10 @@ private: |
SkAutoTUnref<Benchmark> fBenchmark; |
// support framework |
- SkAutoTUnref<SkSurface> fSurface; |
- SkAutoTUnref<GrContext> fContext; |
- SkAutoTUnref<GrRenderTarget> fRenderTarget; |
- AttachmentInfo fAttachmentInfo; |
- SkAutoTUnref<const GrGLInterface> fInterface; |
+ SkAutoTUnref<VisualBench> fOwner; |
SkAutoTDelete<ResultsWriter> fResults; |
- typedef SkOSWindow INHERITED; |
+ typedef VisualModule INHERITED; |
}; |
#endif |