Make GrPipeline hold a GrRenderTargetProxy (instead of a GrRenderTarget)

In a future world where GrSurface no longer has an origin it will be
useful for the GrPipeline to be holding the GrRenderTargetProxy (which will
still have an origin).

Change-Id: I743a8cc07b6b92f8116227fb77b7c37da43cde8a
Reviewed-on: https://skia-review.googlesource.com/26804
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 0483d42..c7f131a 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -18,11 +18,11 @@
 #include "ops/GrOp.h"
 
 void GrPipeline::init(const InitArgs& args) {
-    SkASSERT(args.fRenderTarget);
+    SkASSERT(args.fProxy);
     SkASSERT(args.fProcessors);
     SkASSERT(args.fProcessors->isFinalized());
 
-    fRenderTarget.reset(args.fRenderTarget);
+    fProxy.reset(args.fProxy);
 
     fFlags = args.fFlags;
     if (args.fAppliedClip) {
@@ -99,21 +99,21 @@
 
 GrXferBarrierType GrPipeline::xferBarrierType(const GrCaps& caps) const {
     if (fDstTextureProxy.get() &&
-        fDstTextureProxy.get()->priv().peekTexture() == fRenderTarget.get()->asTexture()) {
+        fDstTextureProxy.get()->priv().peekTexture() == fProxy.get()->priv().peekTexture()) {
         return kTexture_GrXferBarrierType;
     }
     return this->getXferProcessor().xferBarrierType(caps);
 }
 
-GrPipeline::GrPipeline(GrRenderTarget* rt, ScissorState scissorState, SkBlendMode blendmode)
-    : fRenderTarget(rt)
-    , fScissorState()
-    , fWindowRectsState()
-    , fUserStencilSettings(&GrUserStencilSettings::kUnused)
-    , fFlags()
-    , fXferProcessor(GrPorterDuffXPFactory::MakeNoCoverageXP(blendmode))
-    , fFragmentProcessors()
-    , fNumColorProcessors(0) {
+GrPipeline::GrPipeline(GrRenderTargetProxy* proxy, ScissorState scissorState, SkBlendMode blendmode)
+        : fProxy(proxy)
+        , fScissorState()
+        , fWindowRectsState()
+        , fUserStencilSettings(&GrUserStencilSettings::kUnused)
+        , fFlags()
+        , fXferProcessor(GrPorterDuffXPFactory::MakeNoCoverageXP(blendmode))
+        , fFragmentProcessors()
+        , fNumColorProcessors(0) {
     if (ScissorState::kEnabled == scissorState) {
         fScissorState.set({0, 0, 0, 0}); // caller will use the DynamicState struct.
     }
@@ -124,7 +124,7 @@
 bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b) {
     SkASSERT(&a != &b);
 
-    if (a.getRenderTarget() != b.getRenderTarget() ||
+    if (a.proxy() != b.proxy() ||
         a.fFragmentProcessors.count() != b.fFragmentProcessors.count() ||
         a.fNumColorProcessors != b.fNumColorProcessors ||
         a.fScissorState != b.fScissorState ||