More efficient text rendering on path

Change-Id: I004c15473b527df0f296c54a6a3e9b29505fd9b9
diff --git a/libs/hwui/SkiaCanvasProxy.cpp b/libs/hwui/SkiaCanvasProxy.cpp
index f264a35..c4556c4 100644
--- a/libs/hwui/SkiaCanvasProxy.cpp
+++ b/libs/hwui/SkiaCanvasProxy.cpp
@@ -23,6 +23,7 @@
 #include <SkPixelRef.h>
 #include <SkRect.h>
 #include <SkRRect.h>
+#include <SkRSXform.h>
 #include <SkSurface.h>
 
 #include <memory>
@@ -348,11 +349,26 @@
 
 void SkiaCanvasProxy::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
         const SkMatrix* matrix, const SkPaint& origPaint) {
-    // convert to glyphIDs if necessary
-    GlyphIDConverter glyphs(text, byteLength, origPaint);
-    mCanvas->drawGlyphsOnPath(glyphs.glyphIDs, glyphs.count, path, 0, 0, glyphs.paint);
+    SkDEBUGFAIL("SkiaCanvasProxy::onDrawTextOnPath is not supported");
 }
 
+void SkiaCanvasProxy::onDrawTextRSXform(const void* text, size_t byteLength,
+        const SkRSXform xform[], const SkRect* cullRect, const SkPaint& paint) {
+    GlyphIDConverter glyphs(text, byteLength, paint); // Just get count
+    SkMatrix localM, currM, origM;
+    mCanvas->getMatrix(&currM);
+    origM = currM;
+    for (int i = 0; i < glyphs.count; i++) {
+        localM.setRSXform(*xform++);
+        currM.setConcat(origM, localM);
+        mCanvas->setMatrix(currM);
+        this->onDrawText((char*)text + (byteLength / glyphs.count * i),
+                         byteLength / glyphs.count, 0, 0, paint);
+    }
+    mCanvas->setMatrix(origM);
+}
+
+
 void SkiaCanvasProxy::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
         const SkPaint& paint) {
     SkDEBUGFAIL("SkiaCanvasProxy::onDrawTextBlob is not supported");