void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer) const { int i, n; // we never record bitmaps anymore, only images SkASSERT(fBitmaps.count() == 0); if ((n = fPaints.count()) > 0) { write_tag_size(buffer, SK_PICT_PAINT_BUFFER_TAG, n); for (i = 0; i < n; i++) { buffer.writePaint(fPaints[i]); } } if ((n = fPaths.count()) > 0) { write_tag_size(buffer, SK_PICT_PATH_BUFFER_TAG, n); buffer.writeInt(n); for (int i = 0; i < n; i++) { buffer.writePath(fPaths[i]); } } if (fTextBlobCount > 0) { write_tag_size(buffer, SK_PICT_TEXTBLOB_BUFFER_TAG, fTextBlobCount); for (i = 0; i < fTextBlobCount; ++i) { fTextBlobRefs[i]->flatten(buffer); } } if (fImageCount > 0) { write_tag_size(buffer, SK_PICT_IMAGE_BUFFER_TAG, fImageCount); for (i = 0; i < fImageCount; ++i) { buffer.writeImage(fImageRefs[i]); } } }
void SkPath1DPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fAdvance); if (fAdvance > 0) { buffer.writePath(fPath); buffer.writeScalar(fInitialOffset); buffer.writeUInt(fStyle); } }
void SkPathHeap::flatten(SkWriteBuffer& buffer) const { int count = fPaths.count(); buffer.writeInt(count); SkPath* const* iter = fPaths.begin(); SkPath* const* stop = fPaths.end(); while (iter < stop) { buffer.writePath(**iter); iter++; } }
static void Write(SkWriteBuffer& writer, const SkPath* path) { writer.writePath(*path); }
void SkPath2DPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeMatrix(this->getMatrix()); buffer.writePath(fPath); }