Add GM configs that test rendering to a GL backend texture and render target

This also adds GrGpu::create/deleteTestingOnlyBackendRenderTarget. Implemented in GL only for now.

Change-Id: I9e5fdc953c4a249959af89e08332f520cefe9d90
Reviewed-on: https://skia-review.googlesource.com/113305
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index d88edf1..3f1056d 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -52,14 +52,21 @@
 // * backends that represent a shorthand of above (such as "glmsaa16" representing
 // "gpu(api=gl,samples=16)")
 class SkCommandLineConfigGpu : public SkCommandLineConfig {
-  public:
+public:
+    enum class SurfType {
+        kDefault,
+        kBackendTexture,
+        kBackendRenderTarget
+    };
     typedef sk_gpu_test::GrContextFactory::ContextType ContextType;
     typedef sk_gpu_test::GrContextFactory::ContextOverrides ContextOverrides;
+
     SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
-                           ContextType contextType, bool useNVPR, bool useDIText,
-                           int samples, SkColorType colorType, SkAlphaType alphaType,
+                           ContextType contextType, bool useNVPR, bool useDIText, int samples,
+                           SkColorType colorType, SkAlphaType alphaType,
                            sk_sp<SkColorSpace> colorSpace, bool useStencilBuffers,
-                           bool testThreading);
+                           bool testThreading, SurfType);
+
     const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
     ContextType getContextType() const { return fContextType; }
     ContextOverrides getContextOverrides() const { return fContextOverrides; }
@@ -74,8 +81,9 @@
     SkAlphaType getAlphaType() const { return fAlphaType; }
     SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
     bool getTestThreading() const { return fTestThreading; }
+    SurfType getSurfType() const { return fSurfType; }
 
-  private:
+private:
     ContextType fContextType;
     ContextOverrides fContextOverrides;
     bool fUseDIText;
@@ -84,6 +92,7 @@
     SkAlphaType fAlphaType;
     sk_sp<SkColorSpace> fColorSpace;
     bool fTestThreading;
+    SurfType fSurfType;
 };
 #endif