Flutter Engine
The Flutter Engine
CodecBench.h
Go to the documentation of this file.
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 CodecBench_DEFINED
9#define CodecBench_DEFINED
10
11#include "bench/Benchmark.h"
12#include "include/core/SkData.h"
17
18/**
19 * Time SkCodec.
20 */
21class CodecBench : public Benchmark {
22public:
23 // Calls encoded->ref()
25
26protected:
27 const char* onGetName() override;
28 bool isSuitableFor(Backend backend) override;
29 void onDraw(int n, SkCanvas* canvas) override;
30 void onDelayedSetup() override;
31
32private:
33 SkString fName;
34 const SkColorType fColorType;
35 const SkAlphaType fAlphaType;
36 sk_sp<SkData> fData;
37 SkImageInfo fInfo; // Set in onDelayedSetup.
38 SkAutoMalloc fPixelStorage;
39 using INHERITED = Benchmark;
40};
41#endif // CodecBench_DEFINED
const char * backend
SkAlphaType
Definition: SkAlphaType.h:26
SkColorType
Definition: SkColorType.h:19
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
bool isSuitableFor(Backend backend) override
Definition: CodecBench.cpp:36
void onDelayedSetup() override
Definition: CodecBench.cpp:40
const char * onGetName() override
Definition: CodecBench.cpp:32
void onDraw(int n, SkCanvas *canvas) override
Definition: CodecBench.cpp:50
CodecBench(SkString basename, SkData *encoded, SkColorType colorType, SkAlphaType alphaType)
Definition: CodecBench.cpp:19
Definition: SkData.h:25
basename
Definition: malisc.py:23