diff options
author | joshualitt <joshualitt@chromium.org> | 2015-05-27 09:19:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-27 09:19:03 -0700 |
commit | da7b843fbd263e3421eef27c833206024dae8528 (patch) | |
tree | 2d6f9062e1638d8c18c7eaf40bff716472347886 /tools/VisualBench.h | |
parent | a681433d42323d6d48e1aa3cb2ef97fb9d958d93 (diff) |
CL to add setFullscreen and setVsync to SkWindow
BUG=skia:
Review URL: https://codereview.chromium.org/1151333004
Diffstat (limited to 'tools/VisualBench.h')
-rw-r--r-- | tools/VisualBench.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/VisualBench.h b/tools/VisualBench.h new file mode 100644 index 0000000000..d9e0b50866 --- /dev/null +++ b/tools/VisualBench.h @@ -0,0 +1,59 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + */ + +#ifndef VisualBench_DEFINED +#define VisualBench_DEFINED + +#include "SkWindow.h" + +#include "SkPicture.h" +#include "SkSurface.h" +#include "gl/SkGLContext.h" + +class GrContext; +struct GrGLInterface; +class GrRenderTarget; +class SkCanvas; + +/* + * A Visual benchmarking tool for gpu benchmarking + */ +class VisualBench : public SkOSWindow { +public: + VisualBench(void* hwnd, int argc, char** argv); + ~VisualBench() override; + +protected: + SkSurface* createSurface() override; + + void draw(SkCanvas* canvas) override; + + void onSizeChange() override; + +private: + void setTitle(); + bool setupBackend(); + void setupRenderTarget(); + bool onHandleChar(SkUnichar unichar) override; + + int fCurrentLoops; + int fCurrentPicture; + int fCurrentFrame; + SkTArray<SkPicture*> fPictures; + + // support framework + SkAutoTUnref<SkSurface> fSurface; + SkAutoTUnref<GrContext> fContext; + SkAutoTUnref<GrRenderTarget> fRenderTarget; + AttachmentInfo fAttachmentInfo; + SkAutoTUnref<const GrGLInterface> fInterface; + + typedef SkOSWindow INHERITED; +}; + +#endif |