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 BitmapRegionDecoderBench_DEFINED | |
9 #define BitmapRegionDecoderBench_DEFINED | |
10 | |
11 #include "Benchmark.h" | |
12 #include "SkBitmapRegionDecoderInterface.h" | |
13 #include "SkData.h" | |
14 #include "SkImageInfo.h" | |
15 #include "SkRefCnt.h" | |
16 #include "SkString.h" | |
17 | |
18 /** | |
19 * Time SkBitmapRegionDecoder. | |
20 * | |
21 * The aim of this benchmark is not to duplicate the use cases that we test in the SubsetBenches. | |
22 * Instead we assume that the SubsetBenches give us enough information to choos e an appropriate | |
23 * approach to subsetting. | |
24 * | |
25 * This benchmark combines subsetting with scaling, allowing us to test the spe ed of several | |
26 * different approaches to scaling while subsetting. | |
27 */ | |
28 class BitmapRegionDecoderBench : public Benchmark { | |
29 public: | |
30 // Calls encoded->ref() | |
31 BitmapRegionDecoderBench(SkString basename, SkData* encoded, | |
scroggo
2015/09/17 20:05:38
Probably want to use a const ref for basename. (Al
msarett
2015/09/18 13:22:30
I like const char*, since that is what we're using
| |
32 SkBitmapRegionDecoderInterface::Strategy strategy, SkColorType color Type, | |
33 uint32_t sampleSize, const SkIRect& subset); | |
34 | |
35 protected: | |
36 const char* onGetName() override; | |
37 bool isSuitableFor(Backend backend) override; | |
38 void onDraw(const int n, SkCanvas* canvas) override; | |
39 | |
40 private: | |
41 SkString fName; | |
42 SkAutoTUnref<SkData> fData; | |
43 const SkBitmapRegionDecoderInterface::Strategy fStrategy; | |
44 const SkColorType fColorType; | |
45 const uint32_t fSampleSize; | |
46 const SkIRect fSubset; | |
47 typedef Benchmark INHERITED; | |
48 }; | |
49 #endif // BitmapRegionDecoderBench_DEFINED | |
OLD | NEW |