Flutter Engine
The Flutter Engine
AndroidCodecBench.h
Go to the documentation of this file.
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 AndroidCodecBench_DEFINED
9#define AndroidCodecBench_DEFINED
10
11#include "bench/Benchmark.h"
12#include "include/core/SkData.h"
17
18/**
19 * Time SkAndroidCodec.
20 */
22public:
23 // Calls encoded->ref()
24 AndroidCodecBench(SkString basename, SkData* encoded, int sampleSize);
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 sk_sp<SkData> fData;
35 const int fSampleSize;
36 SkImageInfo fInfo; // Set in onDelayedSetup.
37 SkAutoMalloc fPixelStorage; // Set in onDelayedSetup.
38 using INHERITED = Benchmark;
39};
40#endif // AndroidCodecBench_DEFINED
const char * backend
void onDraw(int n, SkCanvas *canvas) override
void onDelayedSetup() override
bool isSuitableFor(Backend backend) override
const char * onGetName() override
AndroidCodecBench(SkString basename, SkData *encoded, int sampleSize)
Definition: SkData.h:25
basename
Definition: malisc.py:23