void SkPicture::flatten(SkWriteBuffer& buffer) const { SkPictInfo info = this->createHeader(); SkAutoTDelete<SkPictureData> data(this->backport()); buffer.writeByteArray(&info.fMagic, sizeof(info.fMagic)); buffer.writeUInt(info.fVersion); buffer.writeRect(info.fCullRect); buffer.writeUInt(info.fFlags); if (data) { buffer.writeBool(true); data->flatten(buffer); } else { buffer.writeBool(false); } }
void SkPixelRef::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); fInfo.flatten(buffer); buffer.writeBool(fIsImmutable); // We write the gen ID into the picture for within-process recording. This // is safe since the same genID will never refer to two different sets of // pixels (barring overflow). However, each process has its own "namespace" // of genIDs. So for cross-process recording we write a zero which will // trigger assignment of a new genID in playback. if (buffer.isCrossProcess()) { buffer.writeUInt(0); } else { buffer.writeUInt(fGenerationID); fUniqueGenerationID = false; // Conservative, a copy is probably about to exist. } }
void SkBitmapProcShader::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); buffer.writeBitmap(fRawBitmap); buffer.writeUInt(fTileModeX); buffer.writeUInt(fTileModeY); }
void SkImageShader::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fTileModeX); buffer.writeUInt(fTileModeY); buffer.writeMatrix(this->getLocalMatrix()); buffer.writeImage(fImage.get()); SkASSERT(fClampAsIfUnpremul == false); }
void SkPath1DPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fAdvance); if (fAdvance > 0) { buffer.writePath(fPath); buffer.writeScalar(fInitialOffset); buffer.writeUInt(fStyle); } }
void SkPaintOptionsAndroid::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fFontVariant); #ifdef SKLANG_OPT buffer.writeString(getLanguage().getTag().c_str()); #else buffer.writeString(fLanguage.getTag().c_str()); #endif buffer.writeBool(fUseFontFallbacks); }
void SkImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeInt(fInputCount); for (int i = 0; i < fInputCount; i++) { SkImageFilter* input = this->getInput(i); buffer.writeBool(input != nullptr); if (input != nullptr) { buffer.writeFlattenable(input); } } buffer.writeRect(fCropRect.rect()); buffer.writeUInt(fCropRect.flags()); }
void SkImageShader::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fTileModeX); buffer.writeUInt(fTileModeY); buffer.writeMatrix(this->getLocalMatrix()); buffer.writeImage(fImage); }
void flatten(SkWriteBuffer& buffer) const override { buffer.writeUInt(fA); buffer.writeUInt(fB); buffer.writeUInt(fC); buffer.writeUInt(fD); }
void SkModeColorFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeColor(fColor); buffer.writeUInt(fMode); }
void SkBitmapProcShader::flatten(SkWriteBuffer& buffer) const { buffer.writeMatrix(this->getLocalMatrix()); buffer.writeBitmap(fRawBitmap); buffer.writeUInt(fTileModeX); buffer.writeUInt(fTileModeY); }
void SkLerpXfermode::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); buffer.writeUInt(fScale256); }
static void write_tag_size(SkWriteBuffer& buffer, uint32_t tag, size_t size) { buffer.writeUInt(tag); buffer.writeUInt(SkToU32(size)); }
void SkAvoidXfermode::flatten(SkWriteBuffer& buffer) const { buffer.writeColor(fOpColor); buffer.writeUInt(fTolerance); buffer.writeUInt(fMode); }
void SkLerpXfermode::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fScale256); }
void SkTrimPE::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fStartT); buffer.writeScalar(fStopT); buffer.writeUInt(static_cast<uint32_t>(fMode)); }