staticbool check_glyph_position(SkPoint position) { // Prevent glyphs from being drawn outside of or straddling the edge of device space. // Comparisons written a little weirdly so that NaN coordinates are treated safely. auto gt = [](float a, int b) { return !(a <= (float)b); }; auto lt = [](float a, int b) { return !(a >= (float)b); }; return !(gt(position.fX, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
lt(position.fX, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)) ||
gt(position.fY, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
lt(position.fY, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)));
}
void SkDraw::paintMasks(SkZip<const SkGlyph*, SkPoint> accepted, const SkPaint& paint) const { // The size used for a typical blitter.
SkSTArenaAlloc<3308> alloc;
SkBlitter* blitter = SkBlitter::Choose(fDst,
*fCTM,
paint,
&alloc, false,
fRC->clipShader(),
SkSurfacePropsCopyOrDefault(fProps));
// this extra test is worth it, assuming that most of the time it succeeds // since we can avoid writing to storage if (!clipBounds.containsNoEmptyCheck(mask.fBounds)) { if (!storage.intersect(mask.fBounds, clipBounds)) { continue;
}
bounds = &storage;
}
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.