auto sharedGenerator = this->generator();
SkAutoMutexExclusive mutex(sharedGenerator->fMutex);
auto pictureIG = static_cast<SkPictureImageGenerator*>(sharedGenerator->fGenerator.get()); if (pictureIG->fPaint.getMaybeNull()) { // A full paint complicates the potential key too much. returnfalse;
}
const SkImageInfo& ii = sharedGenerator->getInfo(); if (!ii.colorSpace()->isSRGB()) { // We only return key values if the colorSpace is sRGB. returnfalse;
}
const SkMatrix& m = pictureIG->fMatrix; if (!m.isIdentity() && !m.isTranslate()) { // To keep the key small we only cache simple (<= translation) matrices returnfalse;
}
// The 0th slot usually holds either the SkBitmap's ID or the image's. In those two cases // slot #1 is zero so we can reuse the 0th slot here.
keyValues[0] = (isU8 ? 0x1 : 0x0) | // 1 bit
(pixelGeometry << 1) | // 3 bits
(surfacePropFlags << 4); // 3 bits
keyValues[1] = pictureIG->fPicture->uniqueID();
SkASSERT(keyValues[1] != 0); // Double check we don't collide w/ bitmap or image keys
keyValues[2] = width;
keyValues[3] = height;
memcpy(&keyValues[4], &transX, sizeof(uint32_t));
memcpy(&keyValues[5], &transY, sizeof(uint32_t)); returntrue;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 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.