Index: src/core/SkPictureRecord.cpp |
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp |
index 4a6ece17f25a8ce864601ffd706cdf2ebb4aa42a..17ed1aa20b69ea5c1470e82c06280d935bde01a7 100644 |
--- a/src/core/SkPictureRecord.cpp |
+++ b/src/core/SkPictureRecord.cpp |
@@ -603,6 +603,30 @@ void SkPictureRecord::onDrawTextOnPath(const void* text, size_t byteLength, cons |
this->validate(initialOffset, size); |
} |
+void SkPictureRecord::onDrawTextRSXform(const void* text, size_t byteLength, |
+ const SkRSXform xform[], const SkRect* cull, |
+ const SkPaint& paint) { |
+ const int count = paint.countText(text, byteLength); |
+ // [op + paint-index + count + flags + length] + [text] + [xform] + cull |
+ size_t size = 5 * kUInt32Size + SkAlign4(byteLength) + count * sizeof(SkRSXform); |
+ uint32_t flags = 0; |
+ if (cull) { |
+ flags |= DRAW_TEXT_RSXFORM_HAS_CULL; |
+ size += sizeof(SkRect); |
+ } |
+ |
+ size_t initialOffset = this->addDraw(DRAW_TEXT_RSXFORM, &size); |
+ this->addPaint(paint); |
+ this->addInt(count); |
+ this->addInt(flags); |
+ this->addText(text, byteLength); |
+ fWriter.write(xform, count * sizeof(SkRSXform)); |
+ if (cull) { |
+ fWriter.write(cull, sizeof(SkRect)); |
+ } |
+ this->validate(initialOffset, size); |
+} |
+ |
void SkPictureRecord::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
const SkPaint& paint) { |