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

Unified Diff: bench/SKPBench.h

Issue 425393004: SKPs-as-benches in nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more %.2g Created 6 years, 5 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 | « no previous file | bench/SKPBench.cpp » ('j') | bench/SKPBench.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SKPBench.h
diff --git a/bench/GMBench.h b/bench/SKPBench.h
similarity index 54%
copy from bench/GMBench.h
copy to bench/SKPBench.h
index 75cee6c0639261f3b0e6e549cf7af9d07dda6409..9cc91928204dbb8d4cf3fe2af502bd19d217356f 100644
--- a/bench/GMBench.h
+++ b/bench/SKPBench.h
@@ -5,18 +5,19 @@
* found in the LICENSE file.
*/
+#ifndef SKPBench_DEFINED
+#define SKPBench_DEFINED
+
#include "Benchmark.h"
#include "SkCanvas.h"
-#include "gm.h"
+#include "SkPicture.h"
/**
- * Runs a GM as a benchmark by repeatedly drawing the GM.
+ * Runs an SkPicture as a benchmark by repeatedly drawing it scaled inside a device clip.
*/
-class GMBench : public Benchmark {
+class SKPBench : public Benchmark {
public:
- // Constructor takes ownership of the GM param.
- GMBench(skiagm::GM* gm);
- virtual ~GMBench();
+ SKPBench(const char* name, const SkPicture*, const SkIRect& devClip, SkScalar scale);
protected:
virtual const char* onGetName() SK_OVERRIDE;
@@ -25,7 +26,12 @@ protected:
virtual SkIPoint onGetSize() SK_OVERRIDE;
private:
- skiagm::GM* fGM;
- SkString fName;
+ SkAutoTUnref<const SkPicture> fPic;
+ const SkIRect fClip;
+ const SkScalar fScale;
+ SkString fName;
+
typedef Benchmark INHERITED;
};
+
+#endif
« no previous file with comments | « no previous file | bench/SKPBench.cpp » ('j') | bench/SKPBench.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698