Clean up glyph id handling.

Extract SkPackedID and its strongly typed subclasses SkPackedGlyphID and
SkPackedUnicharID out of SkGlyph. This simplifies the code handling
these types, as well as making it clearer that we wouuld eventually like
to get away from this scheme.

Changes SkScalerContext::getPath to take SkPackedGlyphID.
Changes SkScalerContext::generatePath to take SkGlyphID.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4722

Change-Id: I365c0c618b7ae0d348272155fac7761a69faa920
Reviewed-on: https://skia-review.googlesource.com/4722
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
diff --git a/src/fonts/SkRandomScalerContext.cpp b/src/fonts/SkRandomScalerContext.cpp
index 96a2619..55c7fb3 100644
--- a/src/fonts/SkRandomScalerContext.cpp
+++ b/src/fonts/SkRandomScalerContext.cpp
@@ -25,7 +25,7 @@
     void generateAdvance(SkGlyph*) override;
     void generateMetrics(SkGlyph*) override;
     void generateImage(const SkGlyph&) override;
-    void generatePath(const SkGlyph&, SkPath*) override;
+    void generatePath(SkGlyphID, SkPath*) override;
     void generateFontMetrics(SkPaint::FontMetrics*) override;
 
 private:
@@ -84,7 +84,7 @@
     }
     if (SkMask::kARGB32_Format == format) {
         SkPath path;
-        fProxy->getPath(*glyph, &path);
+        fProxy->getPath(glyph->getPackedID(), &path);
 
         SkRect storage;
         const SkPaint& paint = this->getRandomTypeface()->paint();
@@ -101,7 +101,7 @@
         SkPath      devPath, fillPath;
         SkMatrix    fillToDevMatrix;
 
-        this->internalGetPath(*glyph, &fillPath, &devPath, &fillToDevMatrix);
+        this->internalGetPath(glyph->getPackedID(), &fillPath, &devPath, &fillToDevMatrix);
 
         // just use devPath
         const SkIRect ir = devPath.getBounds().roundOut();
@@ -154,7 +154,7 @@
     if (!fFakeIt) {
         if (SkMask::kARGB32_Format == glyph.fMaskFormat) {
             SkPath path;
-            fProxy->getPath(glyph, &path);
+            fProxy->getPath(glyph.getPackedID(), &path);
 
             SkBitmap bm;
             bm.installPixels(SkImageInfo::MakeN32Premul(glyph.fWidth, glyph.fHeight),
@@ -175,8 +175,8 @@
     }
 }
 
-void SkRandomScalerContext::generatePath(const SkGlyph& glyph, SkPath* path) {
-    fProxy->getPath(glyph, path);
+void SkRandomScalerContext::generatePath(SkGlyphID glyph, SkPath* path) {
+    fProxy->generatePath(glyph, path);
 }
 
 void SkRandomScalerContext::generateFontMetrics(SkPaint::FontMetrics* metrics) {