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

Unified Diff: bench/DecodingBench.h

Issue 1044363002: Add timing SkCodec to nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move allocation outside of the loop. 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
Index: bench/DecodingBench.h
diff --git a/bench/DecodingBench.h b/bench/DecodingBench.h
index 80a474df323abafa2568b82443611ce7d3ff59ec..65fb31283a9e08c6de6cfa450a1d8e7802321bad 100644
--- a/bench/DecodingBench.h
+++ b/bench/DecodingBench.h
@@ -5,7 +5,11 @@
* found in the LICENSE file.
*/
+#ifndef DecodingBench_DEFINED
+#define DecodingBench_DEFINED
+
#include "Benchmark.h"
+#include "SkBitmap.h"
#include "SkImageDecoder.h"
#include "SkImageInfo.h"
#include "SkStream.h"
@@ -25,11 +29,13 @@ protected:
const char* onGetName() override;
bool isSuitableFor(Backend backend) override;
void onDraw(const int n, SkCanvas* canvas) override;
-
+ void onPreDraw() override;
+
private:
- SkString fName;
- SkColorType fColorType;
- SkAutoTDelete<SkMemoryStream> fStream;
- SkAutoTDelete<SkImageDecoder> fDecoder;
+ SkString fName;
+ SkColorType fColorType;
+ SkAutoTDelete<SkMemoryStream> fStream;
+ SkBitmap fBitmap;
typedef Benchmark INHERITED;
};
+#endif // DecodingBench_DEFINED

Powered by Google App Engine
This is Rietveld 408576698