msarett | 2cee902 | 2016-06-03 08:25:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 ColorCodecBench_DEFINED |
| 9 | #define ColorCodecBench_DEFINED |
| 10 | |
| 11 | #include "Benchmark.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 12 | #include "SkAutoMalloc.h" |
msarett | 2cee902 | 2016-06-03 08:25:21 -0700 | [diff] [blame] | 13 | #include "SkData.h" |
| 14 | #include "SkImageInfo.h" |
| 15 | |
msarett | 2cee902 | 2016-06-03 08:25:21 -0700 | [diff] [blame] | 16 | class ColorCodecBench : public Benchmark { |
| 17 | public: |
| 18 | ColorCodecBench(const char* name, sk_sp<SkData> encoded); |
| 19 | |
| 20 | protected: |
| 21 | const char* onGetName() override; |
| 22 | bool isSuitableFor(Backend backend) override; |
| 23 | void onDraw(int n, SkCanvas* canvas) override; |
| 24 | void onDelayedSetup() override; |
| 25 | |
| 26 | private: |
| 27 | void decodeAndXform(); |
| 28 | void xformOnly(); |
msarett | 2cee902 | 2016-06-03 08:25:21 -0700 | [diff] [blame] | 29 | |
Matt Sarett | a9e9bfc | 2016-11-01 12:19:50 -0400 | [diff] [blame] | 30 | SkString fName; |
| 31 | sk_sp<SkData> fEncoded; |
| 32 | SkImageInfo fSrcInfo; |
| 33 | SkImageInfo fDstInfo; |
| 34 | SkAutoMalloc fDst; |
| 35 | SkAutoMalloc fSrc; |
| 36 | sk_sp<SkColorSpace> fDstSpace; |
| 37 | sk_sp<SkColorSpace> fSrcSpace; |
msarett | 2cee902 | 2016-06-03 08:25:21 -0700 | [diff] [blame] | 38 | |
| 39 | typedef Benchmark INHERITED; |
| 40 | }; |
| 41 | #endif // ColorCodecBench_DEFINED |