9#ifdef SK_ENABLE_ANDROID_UTILS
15BitmapRegionDecoderBench::BitmapRegionDecoderBench(
const char* baseName,
SkData* encoded,
18 , fData(
SkRef(encoded))
20 , fSampleSize(sampleSize)
26 fName.printf(
"BRD_%s_%s", baseName, colorName);
27 if (1 != sampleSize) {
28 fName.appendf(
"_%.3f", 1.0f / (
float) sampleSize);
32const char* BitmapRegionDecoderBench::onGetName() {
36bool BitmapRegionDecoderBench::isSuitableFor(Backend
backend) {
37 return Backend::kNonRendering ==
backend;
40void BitmapRegionDecoderBench::onDelayedSetup() {
44void BitmapRegionDecoderBench::onDraw(
int n,
SkCanvas* canvas) {
45 auto ct = fBRD->computeOutputColorType(
fColorType);
46 auto cs = fBRD->computeOutputColorSpace(ct,
nullptr);
47 for (
int i = 0;
i < n;
i++) {
49 SkAssertResult(fBRD->decodeRegion(&bm,
nullptr, fSubset, fSampleSize, ct,
false, cs));
const char * color_type_to_str(SkColorType colorType)
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static std::unique_ptr< BitmapRegionDecoder > Make(sk_sp< SkData > data)