skia2/bench/subset/SubsetSingleBench.h
msarett 0459c9425f Delete dead subset benches from nanobench
This approach to subset decoding is no longer supported.
We have replaced it with an implementation that does not
depend on forked libraries.
https://codereview.chromium.org/1406153015/

BUG=skia:

Review URL: https://codereview.chromium.org/1430493005
2015-11-10 14:52:13 -08:00

45 lines
1.2 KiB
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkImageDecoder.h"
#include "SkImageInfo.h"
#include "SkStream.h"
#include "SkString.h"
/*
*
* This benchmark is designed to test the performance of subset decoding.
* It uses an input width, height, left, and top to decode a single subset.
*
*/
class SubsetSingleBench : public Benchmark {
public:
SubsetSingleBench(const SkString& path,
SkColorType colorType,
uint32_t subsetWidth,
uint32_t subsetHeight,
uint32_t offsetLeft,
uint32_t offsetTop);
protected:
const char* onGetName() override;
bool isSuitableFor(Backend backend) override;
void onDraw(int n, SkCanvas* canvas) override;
private:
SkString fName;
SkColorType fColorType;
const uint32_t fSubsetWidth;
const uint32_t fSubsetHeight;
const uint32_t fOffsetLeft;
const uint32_t fOffsetTop;
SkAutoTDelete<SkMemoryStream> fStream;
typedef Benchmark INHERITED;
};