Reland "Handle translating blob to origin in bulk"

This is a reland of 7a2ff3c9a86ab4dbd2814134648e19bc5fcce5f5

Original change's description:
> Handle translating blob to origin in bulk
>
> Move all the glyphs in bulk. Handling the origin
> translation will be needed to use the bulk APIs.
>
> Change-Id: Ic38ebc8504d874367e4a7291e26f3dfc2c59222b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206397
> Auto-Submit: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: Idc1c96d9386b73c3f6f9dbb89f7eb8618863550a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206906
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index 8cd30bb..39e7f96 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -397,6 +397,10 @@
 
         if (useSDFT) {
 
+            // Translate all glyphs to the origin.
+            SkMatrix translate = SkMatrix::MakeTrans(origin.x(), origin.y());
+            translate.mapPoints(fPositions, glyphRun.positions().data(), glyphRun.runSize());
+
             // Setup distance field runPaint and text ratio
             SkPaint dfPaint = GrTextContext::InitDistanceFieldPaint(runPaint);
             SkScalar cacheToSourceScale;
@@ -420,9 +424,9 @@
                             *ad.getDesc(), effects, *dfFont.getTypefaceOrDefault());
 
             int glyphCount = 0;
-            const SkPoint* positionCursor = glyphRun.positions().data();
+            const SkPoint* positionCursor = fPositions;
             for (auto glyphID : glyphRun.glyphsIDs()) {
-                SkPoint glyphSourcePosition = origin + *positionCursor++;
+                SkPoint glyphSourcePosition = *positionCursor++;
                 const SkGlyph& glyph = strike->getGlyphMetrics(glyphID, {0, 0});
 
                 if (glyph.isEmpty()) {
@@ -465,6 +469,10 @@
             }
         } else if (SkGlyphRunListPainter::ShouldDrawAsPath(runPaint, runFont, viewMatrix)) {
 
+            // Translate all glyphs to the origin.
+            SkMatrix translate = SkMatrix::MakeTrans(origin.x(), origin.y());
+            translate.mapPoints(fPositions, glyphRun.positions().data(), glyphRun.runSize());
+
             // setup our std runPaint, in hopes of getting hits in the cache
             SkPaint pathPaint{runPaint};
             SkFont pathFont{runFont};
@@ -487,9 +495,9 @@
                             *ad.getDesc(), effects,*pathFont.getTypefaceOrDefault());
 
             int glyphCount = 0;
-            const SkPoint* positionCursor = glyphRun.positions().data();
+            const SkPoint* positionCursor = fPositions;
             for (auto glyphID : glyphRun.glyphsIDs()) {
-                SkPoint glyphSourcePosition = origin + *positionCursor++;
+                SkPoint glyphSourcePosition = *positionCursor++;
 
                 // Use outline from {0, 0} because all transforms including subpixel translation
                 // happen during drawing.
@@ -555,7 +563,7 @@
                            && strike->decideCouldDrawFromPath(glyph)) {
                     fPaths.push_back({&glyph, glyphDevicePosition});
                 } else {
-                    addFallback(glyph, glyphSourcePosition);
+                    addFallback(glyph, origin + glyphSourcePosition);
                 }
             }