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

Unified Diff: tools/VisualBench.h

Issue 1151333004: CL to add setFullscreen and setVsync to SkWindow (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
Index: tools/VisualBench.h
diff --git a/tools/VisualBench.h b/tools/VisualBench.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ed4250e7911e534cfce45b413036ca47c2ba1b8
--- /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.
+ *
+ */
+
robertphillips 2015/05/26 21:07:27 VisualBench_DEFINED ?
joshualitt 2015/05/27 14:09:34 Acknowledged.
+#ifndef HelloWorld_DEFINED
+#define HelloWorld_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);
robertphillips 2015/05/26 21:07:27 rm virtual
joshualitt 2015/05/27 14:09:34 Acknowledged.
+ virtual ~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

Powered by Google App Engine
This is Rietveld 408576698