Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 2130643004: drawTextRSXform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update util canvases Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698