blob: b41941b84fd71b4d789ec485ab47b3b2c63a8d3f [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 decoding.
17 * It is invoked from the nanobench.cpp file.
18 *
19 */
20class DecodingBench : public Benchmark {
21public:
22 DecodingBench(SkString path, SkColorType colorType);
23
24protected:
25 const char* onGetName() SK_OVERRIDE;
26 bool isSuitableFor(Backend backend) SK_OVERRIDE;
27 void onDraw(const int n, SkCanvas* canvas) SK_OVERRIDE;
28
29private:
30 SkString fName;
31 SkColorType fColorType;
32 SkAutoTDelete<SkMemoryStream> fStream;
33 SkAutoTDelete<SkImageDecoder> fDecoder;
34 typedef Benchmark INHERITED;
35};