OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2015 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef DecodingBench_DEFINED | |
9 #define DecodingBench_DEFINED | |
10 | |
11 #include "Benchmark.h" | |
12 #include "SkData.h" | |
13 #include "SkImageDecoder.h" | |
14 #include "SkRefCnt.h" | |
15 #include "SkString.h" | |
16 | |
17 /* | |
18 * | |
19 * This benchmark is designed to test the performance of image decoding. | |
20 * It is invoked from the nanobench.cpp file. | |
21 * | |
22 */ | |
23 class DecodingBench : public Benchmark { | |
24 public: | |
25 DecodingBench(SkString path, SkColorType colorType); | |
26 | |
27 protected: | |
28 const char* onGetName() override; | |
29 bool isSuitableFor(Backend backend) override; | |
30 void onDraw(int n, SkCanvas* canvas) override; | |
31 void onDelayedSetup() override; | |
32 | |
33 private: | |
34 SkString fName; | |
35 SkColorType fColorType; | |
36 SkAutoTUnref<SkData> fData; | |
37 SkAutoMalloc fPixelStorage; | |
38 typedef Benchmark INHERITED; | |
39 }; | |
40 #endif // DecodingBench_DEFINED | |
OLD | NEW |