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

Side by Side Diff: bench/DecodingBench.h

Issue 1051973002: Test SkCodec to kIndex8 in nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra newline. Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef DecodingBench_DEFINED 8 #ifndef DecodingBench_DEFINED
9 #define DecodingBench_DEFINED 9 #define DecodingBench_DEFINED
10 10
11 #include "Benchmark.h" 11 #include "Benchmark.h"
12 #include "SkBitmap.h"
13 #include "SkData.h" 12 #include "SkData.h"
14 #include "SkImageDecoder.h" 13 #include "SkImageDecoder.h"
15 #include "SkImageInfo.h"
16 #include "SkRefCnt.h" 14 #include "SkRefCnt.h"
17 #include "SkString.h" 15 #include "SkString.h"
18 16
19 /* 17 /*
20 * 18 *
21 * This benchmark is designed to test the performance of image decoding. 19 * This benchmark is designed to test the performance of image decoding.
22 * It is invoked from the nanobench.cpp file. 20 * It is invoked from the nanobench.cpp file.
23 * 21 *
24 */ 22 */
25 class DecodingBench : public Benchmark { 23 class DecodingBench : public Benchmark {
26 public: 24 public:
27 DecodingBench(SkString path, SkColorType colorType); 25 DecodingBench(SkString path, SkColorType colorType);
28 26
29 protected: 27 protected:
30 const char* onGetName() override; 28 const char* onGetName() override;
31 bool isSuitableFor(Backend backend) override; 29 bool isSuitableFor(Backend backend) override;
32 void onDraw(const int n, SkCanvas* canvas) override; 30 void onDraw(const int n, SkCanvas* canvas) override;
33 void onPreDraw() override; 31 void onPreDraw() override;
34 32
35 private: 33 private:
36 SkString fName; 34 SkString fName;
37 SkColorType fColorType; 35 SkColorType fColorType;
38 SkAutoTUnref<SkData> fData; 36 SkAutoTUnref<SkData> fData;
39 SkBitmap fBitmap; 37 SkAutoMalloc fStorage;
40 typedef Benchmark INHERITED; 38 typedef Benchmark INHERITED;
41 }; 39 };
42 #endif // DecodingBench_DEFINED 40 #endif // DecodingBench_DEFINED
OLDNEW
« bench/CodecBench.h ('K') | « bench/CodecBench.cpp ('k') | bench/DecodingBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698