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 #include "Benchmark.h" | |
9 #include "SkImageDecoder.h" | |
10 #include "SkImageInfo.h" | |
11 #include "SkStream.h" | |
12 #include "SkString.h" | |
13 | |
14 /* | |
15 * | |
16 * This benchmark is designed to test the performance of subset decoding. | |
17 * It uses an input width, height, left, and top to decode a single subset. | |
18 * | |
19 */ | |
20 class SubsetSingleBench : public Benchmark { | |
21 public: | |
22 | |
23 SubsetSingleBench(const SkString& path, | |
24 SkColorType colorType, | |
25 uint32_t subsetWidth, | |
26 uint32_t subsetHeight, | |
27 uint32_t offsetLeft, | |
28 uint32_t offsetTop); | |
29 | |
30 protected: | |
31 const char* onGetName() override; | |
32 bool isSuitableFor(Backend backend) override; | |
33 void onDraw(int n, SkCanvas* canvas) override; | |
34 | |
35 private: | |
36 SkString fName; | |
37 SkColorType fColorType; | |
38 const uint32_t fSubsetWidth; | |
39 const uint32_t fSubsetHeight; | |
40 const uint32_t fOffsetLeft; | |
41 const uint32_t fOffsetTop; | |
42 SkAutoTDelete<SkMemoryStream> fStream; | |
43 typedef Benchmark INHERITED; | |
44 }; | |
OLD | NEW |