Add gltestpersistentcache config that tests GrContextOption's cache.

Uses a new GPU sink that runs each test twice, once to populate the
cache and then again with a new GrContext but a warmed cache. It
verifies that the two generated images are the same.

Change-Id: Iaba195a69751f14ea946afe7174228a813b83a63
Reviewed-on: https://skia-review.googlesource.com/140567
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 7c097ea..fa11cc6 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -57,7 +57,7 @@
                            ContextType contextType, bool useNVPR, bool useDIText, int samples,
                            SkColorType colorType, SkAlphaType alphaType,
                            sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers,
-                           bool testThreading, SurfType);
+                           bool testThreading, bool testPersistentCache, SurfType);
 
     const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
     ContextType getContextType() const { return fContextType; }
@@ -73,6 +73,7 @@
     SkAlphaType getAlphaType() const { return fAlphaType; }
     SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
     bool getTestThreading() const { return fTestThreading; }
+    bool getTestPersistentCache() const { return fTestPersistentCache; }
     SurfType getSurfType() const { return fSurfType; }
 
 private:
@@ -84,6 +85,7 @@
     SkAlphaType fAlphaType;
     sk_sp<SkColorSpace> fColorSpace;
     bool fTestThreading;
+    bool fTestPersistentCache;
     SurfType fSurfType;
 };