/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/
class SkA8_Blitter : public SkBlitter { public:
SkA8_Blitter(const SkPixmap& device, const SkPaint& paint); void blitH(int x, int y, int width) override; void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override; void blitV(int x, int y, int height, SkAlpha alpha) override; void blitRect(int x, int y, int width, int height) override; void blitMask(const SkMask&, const SkIRect&) override;
void SkA8_Blitter::blitRect(int x, int y, int width, int height) {
uint8_t* device = fDevice.writable_addr8(x, y); const size_t dstRB = fDevice.rowBytes();
while (--height >= 0) { for (int i = 0; i < width; ++i) {
dst[i] = u8_lerp(dst[i], fOneProc(fSrc, dst[i]), src[i]);
}
dst += dstRB;
src += srcRB;
}
}
//////////////////
SkBlitter* SkA8Blitter_Choose(const SkPixmap& dst, const SkMatrix& ctm, const SkPaint& paint,
SkArenaAlloc* alloc, bool drawCoverage,
sk_sp<SkShader> clipShader, const SkSurfaceProps&) { if (dst.colorType() != SkColorType::kAlpha_8_SkColorType) { return nullptr;
} if (paint.getShader() || paint.getColorFilter()) { return nullptr;
} if (clipShader) { return nullptr; // would not be hard to support ...?
}
if (drawCoverage) { return alloc->make<SkA8_Coverage_Blitter>(dst, paint);
} else { // we only support certain blendmodes... auto mode = paint.asBlendMode(); if (mode && find_a8_rowproc_pair(*mode)) { return alloc->make<SkA8_Blitter>(dst, paint);
}
} return nullptr;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.