Index: bench/CodecBench.h |
diff --git a/bench/DecodingBench.h b/bench/CodecBench.h |
similarity index 53% |
copy from bench/DecodingBench.h |
copy to bench/CodecBench.h |
index 80a474df323abafa2568b82443611ce7d3ff59ec..6d91e8ebf3a0f51c8799bede525ef8479dc3130f 100644 |
--- a/bench/DecodingBench.h |
+++ b/bench/CodecBench.h |
@@ -5,31 +5,33 @@ |
* found in the LICENSE file. |
*/ |
+#ifndef CodecBench_DEFINED |
+#define CodecBench_DEFINED |
+ |
#include "Benchmark.h" |
-#include "SkImageDecoder.h" |
#include "SkImageInfo.h" |
#include "SkStream.h" |
#include "SkString.h" |
-/* |
- * |
- * This benchmark is designed to test the performance of image decoding. |
- * It is invoked from the nanobench.cpp file. |
- * |
+class SkData; |
+ |
+/** |
+ * Time SkCodec. |
*/ |
-class DecodingBench : public Benchmark { |
+class CodecBench : public Benchmark { |
public: |
- DecodingBench(SkString path, SkColorType colorType); |
+ // 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; |
- |
+ |
private: |
- SkString fName; |
- SkColorType fColorType; |
- SkAutoTDelete<SkMemoryStream> fStream; |
- SkAutoTDelete<SkImageDecoder> fDecoder; |
+ SkString fName; |
+ const SkColorType fColorType; |
+ SkAutoTDelete<SkMemoryStream> fStream; |
typedef Benchmark INHERITED; |
}; |
+#endif // CodecBench_DEFINED |