add rsxform runs to textblobs

Bug: skia:
Change-Id: I72a1921a0300dfdac567e25acbdf20cc168ac0be
Reviewed-on: https://skia-review.googlesource.com/c/175834
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index a9f8834..6ead9d4 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -26,6 +26,7 @@
 
 #include <atomic>
 
+struct SkRSXform;
 struct SkSerialProcs;
 struct SkDeserialProcs;
 
@@ -58,6 +59,8 @@
 
         Pass nullptr for intervals to determine the size of the interval array.
 
+        Runs within the blob that contain SkRSXforms are ignored when computing intercepts.
+
         @param bounds     lower and upper line parallel to the advance
         @param intervals  returned intersections; may be nullptr
         @param paint      specifies stroking, SkPathEffect that affects the result; may be nullptr
@@ -128,6 +131,11 @@
                                              const SkPoint pos[], const SkFont& font,
                                              SkTextEncoding encoding = kUTF8_SkTextEncoding);
 
+    // Experimental
+    static sk_sp<SkTextBlob> MakeFromRSXform(const void* text, size_t byteLength,
+                                             const SkRSXform xform[], const SkFont& font,
+                                             SkTextEncoding encoding = kUTF8_SkTextEncoding);
+
     /** Writes data to allow later reconstruction of SkTextBlob. memory points to storage
         to receive the encoded data, and memory_size describes the size of storage.
         Returns bytes used if provided storage is large enough to hold all data;
@@ -332,6 +340,9 @@
     const RunBuffer& allocRunPos(const SkFont& font, int count,
                                  const SkRect* bounds = nullptr);
 
+    // Experimental, RunBuffer.pos points to SkRSXforms
+    const RunBuffer& allocRunRSXform(const SkFont& font, int count);
+
 private:
     const RunBuffer& allocRunText(const SkFont& font,
                                   int count,
@@ -346,6 +357,10 @@
     const RunBuffer& allocRunTextPos(const SkFont& font, int count,
                                      int textByteCount, SkString lang,
                                      const SkRect* bounds = nullptr);
+    const RunBuffer& allocRunRSXform(const SkFont& font, int count,
+                                     int textByteCount, SkString lang,
+                                     const SkRect* bounds = nullptr);
+
     void reserve(size_t size);
     void allocInternal(const SkFont& font, SkTextBlob::GlyphPositioning positioning,
                        int count, int textBytes, SkPoint offset, const SkRect* bounds);