blob: 4941aa10c17d70086c520217a599e49547cd4a85 [file] [log] [blame]
msarett95f192d2015-02-13 09:05:41 -08001/*
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 image subset decoding.
17 * It is invoked from the nanobench.cpp file.
18 *
19 */
20class DecodingSubsetBench : public Benchmark {
21public:
22 DecodingSubsetBench(SkString path, SkColorType colorType,
23 const int divisor);
24
25protected:
mtklein36352bf2015-03-25 18:17:31 -070026 const char* onGetName() override;
27 bool isSuitableFor(Backend backend) override;
28 void onDraw(const int n, SkCanvas* canvas) override;
msarett95f192d2015-02-13 09:05:41 -080029
30private:
31 SkString fName;
32 SkColorType fColorType;
33 const int fDivisor;
34 SkAutoTDelete<SkMemoryStream> fStream;
35 SkAutoTDelete<SkImageDecoder> fDecoder;
36 typedef Benchmark INHERITED;
37};