working on image and nightly housekeeping bot

Add more examples and docs for SkImage; still a ways to go.
Fix bit-rotted examples.
Add typedef support.
Add json driver to pick files to work on; remove special-casing.
Fix unordered map traversal that made md output unreliable.

TBR=rmistry@google.com
Docs-Preview: https://skia.org/?cl=80060
Bug: skia:6898
Change-Id: Ib8eb9fdfa5a9db61c8332e657fa2e2f4b96a665f
Reviewed-on: https://skia-review.googlesource.com/80060
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index b2c70f5..8979b87 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -4711,14 +4711,15 @@
 
 #Code
     struct Lattice {
-        enum Flags {...
+        enum RectType ...
 
-        const int*     fXDivs;
-        const int*     fYDivs;
-        const Flags*   fFlags;
-        int            fXCount;
-        int            fYCount;
-        const SkIRect* fBounds;
+        const int*      fXDivs;
+        const int*      fYDivs;
+        const RectType* fRectTypes;
+        int             fXCount;
+        int             fYCount;
+        const SkIRect*  fBounds;
+        const SkColor*  fColors;
     };
 ##
 
@@ -4730,17 +4731,28 @@
     The grid entries not on even columns and rows are scaled to fit the
     remaining space, if any.
 
-    #Enum Flags
+    #Enum RectType
         #Code
-            enum Flags : uint8_t {
-                kTransparent_Flags = 1 << 0,
+            enum RectType : uint8_t {
+                kDefault = 0,
+                kTransparent,
+                kFixedColor,
             };
         ##
 
-        Optional setting per rectangular grid entry to make it transparent.
+        Optional setting per rectangular grid entry to make it transparent,
+        or to fill the grid entry with a color.
 
-        #Const kTransparent_Flags 1
-            Set to skip lattice rectangle by making it transparent.
+        #Const kDefault 0
+            Draws Bitmap into lattice rectangle.
+        ##
+
+        #Const kTransparent 1
+            Skips lattice rectangle by making it transparent.
+        ##
+
+        #Const kFixedColor 2
+            Draws one of fColors into lattice rectangle.
         ##
     ##
 
@@ -4760,14 +4772,16 @@
         grid entries.
     ##
 
-    #Member const Flags*  fFlags
-        Optional array of Flags, one per rectangular grid entry:
+    #Member const RectType* fRectTypes
+        Optional array of fill types, one per rectangular grid entry:
         array length must be
     #Formula
         (fXCount + 1) * (fYCount + 1)
     ##
         .
 
+        Each RectType is one of: kDefault, kTransparent, kFixedColor.
+
         Array entries correspond to the rectangular grid entries, ascending
         left to right and then top to bottom.
     ##
@@ -4787,6 +4801,18 @@
        If nullptr, source bounds is dimensions of Bitmap or Image.
     ##
 
+    #Member const SkColor*   fColors
+       Optional array of colors, one per rectangular grid entry.
+       Array length must be
+       #Formula
+       (fXCount + 1) * (fYCount + 1)
+       ##
+       .
+
+       Array entries correspond to the rectangular grid entries, ascending
+       left to right, then top to bottom.
+    ##
+
 #Struct Lattice ##
 
 #Method void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst,
@@ -5329,26 +5355,26 @@
 #Example
 #Height 120
     void draw(SkCanvas* canvas) {
-        SkTextBlobBuilder textBlobBuilder;

-        const char bunny[] = "/(^x^)\\";

-        const int len = sizeof(bunny) - 1;

-        uint16_t glyphs[len];

-        SkPaint paint;

-        paint.textToGlyphs(bunny, len, glyphs);

+        SkTextBlobBuilder textBlobBuilder;
+        const char bunny[] = "/(^x^)\\";
+        const int len = sizeof(bunny) - 1;
+        uint16_t glyphs[len];
+        SkPaint paint;
+        paint.textToGlyphs(bunny, len, glyphs);
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-        int runs[] = { 3, 1, 3 };

-        SkPoint textPos = { 20, 100 };

-        int glyphIndex = 0;

-        for (auto runLen : runs) {

-            paint.setTextSize(1 == runLen ? 20 : 50);

-            const SkTextBlobBuilder::RunBuffer& run = 

-                    textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY);

-            memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen);

-            textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr);

-            glyphIndex += runLen;

-        }

-        sk_sp<const SkTextBlob> blob = textBlobBuilder.make();

-        paint.reset();

+        int runs[] = { 3, 1, 3 };
+        SkPoint textPos = { 20, 100 };
+        int glyphIndex = 0;
+        for (auto runLen : runs) {
+            paint.setTextSize(1 == runLen ? 20 : 50);
+            const SkTextBlobBuilder::RunBuffer& run = 
+                    textBlobBuilder.allocRun(paint, runLen, textPos.fX, textPos.fY);
+            memcpy(run.glyphs, &glyphs[glyphIndex], sizeof(glyphs[0]) * runLen);
+            textPos.fX += paint.measureText(&glyphs[glyphIndex], sizeof(glyphs[0]) * runLen, nullptr);
+            glyphIndex += runLen;
+        }
+        sk_sp<const SkTextBlob> blob = textBlobBuilder.make();
+        paint.reset();
         canvas->drawTextBlob(blob.get(), 0, 0, paint);
     }
 ##
@@ -5390,7 +5416,7 @@
         SkPaint paint;
         paint.setTextSize(50);
         paint.setColor(SK_ColorRED);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);

+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         const SkTextBlobBuilder::RunBuffer& run = 
                 textBlobBuilder.allocRun(paint, 1, 20, 100);
         run.glyphs[0] = 20;