OLD | NEW |
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 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
11 #include "SkStream.h" | 11 #include "SkStream.h" |
12 #include "SkString.h" | 12 #include "SkString.h" |
13 | 13 |
14 /* | 14 /* |
15 * | 15 * |
16 * This benchmark is designed to test the performance of subset decoding. | 16 * This benchmark is designed to test the performance of subset decoding. |
17 * Choose subsets to mimic a user zooming in or out on a photo. | 17 * Choose subsets to mimic a user zooming in or out on a photo. |
18 * | 18 * |
19 */ | 19 */ |
20 class SubsetZoomBench : public Benchmark { | 20 class SubsetZoomBench : public Benchmark { |
21 public: | 21 public: |
22 | 22 |
23 SubsetZoomBench(const SkString& path, | 23 SubsetZoomBench(const SkString& path, |
24 SkColorType colorType, | 24 SkColorType colorType, |
25 uint32_t subsetWidth, | 25 uint32_t subsetWidth, |
26 uint32_t subsetHeight, | 26 uint32_t subsetHeight); |
27 bool useCodec); | |
28 | 27 |
29 protected: | 28 protected: |
30 const char* onGetName() override; | 29 const char* onGetName() override; |
31 bool isSuitableFor(Backend backend) override; | 30 bool isSuitableFor(Backend backend) override; |
32 void onDraw(int n, SkCanvas* canvas) override; | 31 void onDraw(int n, SkCanvas* canvas) override; |
33 | 32 |
34 private: | 33 private: |
35 SkString fName; | 34 SkString fName; |
36 SkColorType fColorType; | 35 SkColorType fColorType; |
37 const uint32_t fSubsetWidth; | 36 const uint32_t fSubsetWidth; |
38 const uint32_t fSubsetHeight; | 37 const uint32_t fSubsetHeight; |
39 const bool fUseCodec; | |
40 SkAutoTDelete<SkMemoryStream> fStream; | 38 SkAutoTDelete<SkMemoryStream> fStream; |
41 typedef Benchmark INHERITED; | 39 typedef Benchmark INHERITED; |
42 }; | 40 }; |
OLD | NEW |