Store the dst texture used by an XP in GrPipeline rather than in the XP.

This will allow the XP to be created before the dst texture.

Change-Id: I3e5bdfa8e5d47e58a3560792ce5cf3899d30a024
Reviewed-on: https://skia-review.googlesource.com/11011
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 2aa572d..29fe35c 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -78,8 +78,13 @@
     this->setFragmentData(primProc, pipeline, &nextSamplerIdx);
 
     const GrXferProcessor& xp = pipeline.getXferProcessor();
-    fXferProcessor->setData(fProgramDataManager, xp);
-    this->bindTextures(xp, pipeline.getAllowSRGBInputs(), &nextSamplerIdx);
+    SkIPoint offset;
+    GrTexture* dstTexture = pipeline.dstTexture(&offset);
+    fXferProcessor->setData(fProgramDataManager, xp, dstTexture, offset);
+    if (dstTexture) {
+        fGpu->bindTexture(nextSamplerIdx++, GrSamplerParams::ClampNoFilter(), true,
+                          static_cast<GrGLTexture*>(dstTexture));
+    }
 }
 
 void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,