Check for xfer barriers in GrBatch, auto-issue barriers in GrGpu

Review URL: https://codereview.chromium.org/1287973003
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 64016cf..9c468e7 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -14,6 +14,7 @@
 #include "GrGpuResourcePriv.h"
 #include "GrIndexBuffer.h"
 #include "GrPathRendering.h"
+#include "GrPipeline.h"
 #include "GrResourceCache.h"
 #include "GrRenderTargetPriv.h"
 #include "GrStencilAttachment.h"
@@ -381,6 +382,10 @@
 
 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
     this->handleDirtyContext();
+    if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->caps())) {
+        this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
+    }
+
     GrVertices::Iterator iter;
     const GrNonInstancedVertices* verts = iter.init(vertices);
     do {