void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); if (!buffer.isCrossProcess()) { bool hasPicture = (fPicture != NULL); buffer.writeBool(hasPicture); if (hasPicture) { fPicture->flatten(buffer); } } else { buffer.writeBool(false); } buffer.writeRect(fCropRect); }
void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { if (buffer.isCrossProcess() && SkPicture::PictureIOSecurityPrecautionsEnabled()) { buffer.writeBool(false); } else { bool hasPicture = (fPicture != NULL); buffer.writeBool(hasPicture); if (hasPicture) { fPicture->flatten(buffer); } } buffer.writeRect(fCropRect); buffer.writeInt(fPictureResolution); if (kLocalSpace_PictureResolution == fPictureResolution) { buffer.writeInt(fFilterQuality); } }
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. } }