Index: bench/CodecBench.h |
diff --git a/bench/CodecBench.h b/bench/CodecBench.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2bc4ba9a6f886f3c7b975057a1ffd1203dc1ad5c |
--- /dev/null |
+++ b/bench/CodecBench.h |
@@ -0,0 +1,39 @@ |
+/* |
+ * 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 CodecBench_DEFINED |
+#define CodecBench_DEFINED |
+ |
+#include "Benchmark.h" |
+#include "SkBitmap.h" |
+#include "SkData.h" |
+#include "SkImageInfo.h" |
+#include "SkRefCnt.h" |
+#include "SkString.h" |
+ |
+/** |
+ * Time SkCodec. |
+ */ |
+class CodecBench : public Benchmark { |
+public: |
+ // Calls encoded->ref() |
+ CodecBench(SkString basename, SkData* encoded, SkColorType colorType); |
+ |
+protected: |
+ const char* onGetName() override; |
+ bool isSuitableFor(Backend backend) override; |
+ void onDraw(const int n, SkCanvas* canvas) override; |
+ void onPreDraw() override; |
+ |
+private: |
+ SkString fName; |
+ const SkColorType fColorType; |
+ SkAutoTUnref<SkData> fData; |
+ SkBitmap fBitmap; |
+ typedef Benchmark INHERITED; |
+}; |
+#endif // CodecBench_DEFINED |