void SkFlipPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); buffer.write32(fSize); // only need to write page0 buffer.writePad(fPage0, fSize); }
void SkImageRef_ashmem::flatten(SkFlattenableWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); const char* uri = getURI(); if (uri) { size_t len = strlen(uri); buffer.write32(len); buffer.writePad(uri, len); } else { buffer.write32(0); } }
void SkMallocPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); buffer.write32(fSize); buffer.writePad(fStorage, fSize); if (fCTable) { buffer.writeBool(true); fCTable->flatten(buffer); } else { buffer.writeBool(false); } }
void SkGroupShape::flatten(SkFlattenableWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); int count = fList.count(); buffer.write32(count); const Rec* rec = fList.begin(); const Rec* stop = fList.end(); while (rec < stop) { buffer.writeFlattenable(rec->fShape); if (rec->fMatrixRef) { char storage[SkMatrix::kMaxFlattenSize]; uint32_t size = rec->fMatrixRef->flatten(storage); buffer.write32(size); buffer.writePad(storage, size); } else { buffer.write32(0); } rec += 1; } }