Don't pass render target to GrGLSLProgramBuilder.

The base class does not use the GrRenderTarget and most subclasses do
not use it eitehr. So remove the GrRenderTarget from these classes and
have specific subclasses store the GrRenderTarget if they need it.

Bug: skia:11809
Change-Id: Idee5419377e1b5e328c8c88666c9344f642beb63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399056
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 53fd545..9ee1b80 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -49,19 +49,17 @@
 }
 
 sk_sp<GrGLProgram> GrGLGpu::ProgramCache::findOrCreateProgram(GrDirectContext* dContext,
-                                                              GrRenderTarget* renderTarget,
                                                               const GrProgramInfo& programInfo) {
     const GrCaps* caps = dContext->priv().caps();
 
-    GrProgramDesc desc = caps->makeDesc(renderTarget, programInfo);
+    GrProgramDesc desc = caps->makeDesc(/*renderTarget*/nullptr, programInfo);
     if (!desc.isValid()) {
         GrCapsDebugf(caps, "Failed to gl program descriptor!\n");
         return nullptr;
     }
 
     Stats::ProgramCacheResult stat;
-    sk_sp<GrGLProgram> tmp = this->findOrCreateProgram(dContext, renderTarget, desc,
-                                                       programInfo, &stat);
+    sk_sp<GrGLProgram> tmp = this->findOrCreateProgramImpl(dContext, desc, programInfo, &stat);
     if (!tmp) {
         fStats.incNumInlineCompilationFailures();
     } else {
@@ -75,7 +73,7 @@
                                                               const GrProgramDesc& desc,
                                                               const GrProgramInfo& programInfo,
                                                               Stats::ProgramCacheResult* stat) {
-    sk_sp<GrGLProgram> tmp = this->findOrCreateProgram(dContext, nullptr, desc, programInfo, stat);
+    sk_sp<GrGLProgram> tmp = this->findOrCreateProgramImpl(dContext, desc, programInfo, stat);
     if (!tmp) {
         fStats.incNumPreCompilationFailures();
     } else {
@@ -85,19 +83,18 @@
     return tmp;
 }
 
-sk_sp<GrGLProgram> GrGLGpu::ProgramCache::findOrCreateProgram(GrDirectContext* dContext,
-                                                              GrRenderTarget* renderTarget,
-                                                              const GrProgramDesc& desc,
-                                                              const GrProgramInfo& programInfo,
-                                                              Stats::ProgramCacheResult* stat) {
+sk_sp<GrGLProgram> GrGLGpu::ProgramCache::findOrCreateProgramImpl(GrDirectContext* dContext,
+                                                                  const GrProgramDesc& desc,
+                                                                  const GrProgramInfo& programInfo,
+                                                                  Stats::ProgramCacheResult* stat) {
     *stat = Stats::ProgramCacheResult::kHit;
     std::unique_ptr<Entry>* entry = fMap.find(desc);
     if (entry && !(*entry)->fProgram) {
         // We've pre-compiled the GL program, but don't have the GrGLProgram scaffolding
         const GrGLPrecompiledProgram* precompiledProgram = &((*entry)->fPrecompiledProgram);
         SkASSERT(precompiledProgram->fProgramID != 0);
-        (*entry)->fProgram = GrGLProgramBuilder::CreateProgram(dContext, renderTarget, desc,
-                                                               programInfo, precompiledProgram);
+        (*entry)->fProgram = GrGLProgramBuilder::CreateProgram(dContext, desc, programInfo,
+                                                               precompiledProgram);
         if (!(*entry)->fProgram) {
             // Should we purge the program ID from the cache at this point?
             SkDEBUGFAIL("Couldn't create program from precompiled program");
@@ -108,8 +105,7 @@
         *stat = Stats::ProgramCacheResult::kPartial;
     } else if (!entry) {
         // We have a cache miss
-        sk_sp<GrGLProgram> program = GrGLProgramBuilder::CreateProgram(dContext, renderTarget,
-                                                                       desc, programInfo);
+        sk_sp<GrGLProgram> program = GrGLProgramBuilder::CreateProgram(dContext, desc, programInfo);
         if (!program) {
             fStats.incNumCompilationFailures();
             return nullptr;