Make pipeline getter a GrDrawBatch::pipeline() a protected method.
authorBrian Salomon <bsalomon@google.com>
Tue, 29 Nov 2016 22:09:20 +0000 (17:09 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 29 Nov 2016 22:58:26 +0000 (22:58 +0000)
This is a baby step towards making getting GrPipeline off GrDrawBatch.

Change-Id: I7e0331f3bcd45d1920a150fefb91e307efeeced1
Reviewed-on: https://skia-review.googlesource.com/5327
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

src/gpu/batches/GrDrawBatch.h

index a5c153e..af1de0d 100644 (file)
@@ -64,11 +64,6 @@ public:
      */
     void getPipelineOptimizations(GrPipelineOptimizations* override) const;
 
-    const GrPipeline* pipeline() const {
-        SkASSERT(fPipelineInstalled);
-        return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get());
-    }
-
     bool installPipeline(const GrPipeline::CreateArgs&);
 
     // TODO no GrPrimitiveProcessors yet read fragment position
@@ -77,13 +72,11 @@ public:
     // TODO: this needs to be updated to return GrSurfaceProxy::UniqueID
     // This is a bit more exciting than the other call sites since it uses the pipeline
     GrGpuResource::UniqueID renderTargetUniqueID() const final {
-        SkASSERT(fPipelineInstalled);
         return this->pipeline()->getRenderTarget()->uniqueID();
     }
 
     // TODO: store a GrRenderTargetContext instead
     GrRenderTarget* renderTarget() const final {
-        SkASSERT(fPipelineInstalled);
         return this->pipeline()->getRenderTarget();
     }
 
@@ -121,6 +114,11 @@ public:
     }
 
 protected:
+    const GrPipeline* pipeline() const {
+        SkASSERT(fPipelineInstalled);
+        return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get());
+    }
+
     virtual void computePipelineOptimizations(GrInitInvariantOutput* color,
                                               GrInitInvariantOutput* coverage,
                                               GrBatchToXPOverrides* overrides) const = 0;