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

Unified Diff: bench/CodecBench.h

Issue 1044363002: Add timing SkCodec to nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/CodecBench.cpp » ('j') | bench/CodecBench.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | bench/CodecBench.cpp » ('j') | bench/CodecBench.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698