diff options
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.h')
-rw-r--r-- | src/gpu/GrGpuCommandBuffer.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.h b/src/gpu/GrGpuCommandBuffer.h index 1be361f81d..31e9a546d5 100644 --- a/src/gpu/GrGpuCommandBuffer.h +++ b/src/gpu/GrGpuCommandBuffer.h @@ -27,12 +27,6 @@ struct SkRect; * the same render target. It is possible that these commands execute immediately (GL), or get * buffered up for later execution (Vulkan). GrOps will execute their draw commands into a * GrGpuCommandBuffer. - * - * Ideally we'd know the GrRenderTarget, or at least its properties when the GrGpuCommandBuffer, is - * created. We also then wouldn't include it in the GrPipeline or as a parameter to the clear and - * discard methods. The logical place for that will be in GrRenderTargetOpList post-MDB. For now - * the render target is redundantly passed to each operation, though it will always be the same - * render target for a given command buffer even pre-MDB. */ class GrGpuCommandBuffer { public: @@ -60,7 +54,10 @@ public: StoreOp fStoreOp; }; - GrGpuCommandBuffer() {} + GrGpuCommandBuffer(GrRenderTarget* rt, GrSurfaceOrigin origin) + : fRenderTarget(rt) + , fOrigin(origin) { + } virtual ~GrGpuCommandBuffer() {} virtual void begin() = 0; @@ -83,28 +80,29 @@ public: const SkRect& bounds); // Performs an upload of vertex data in the middle of a set of a set of draws - virtual void inlineUpload(GrOpFlushState*, GrDrawOp::DeferredUploadFn&, - GrRenderTargetProxy*) = 0; + virtual void inlineUpload(GrOpFlushState*, GrDrawOp::DeferredUploadFn&) = 0; /** - * Clear the passed in render target. Ignores the draw state and clip. + * Clear the owned render target. Ignores the draw state and clip. */ - void clear(GrRenderTargetProxy*, const GrFixedClip&, GrColor); + void clear(const GrFixedClip&, GrColor); - void clearStencilClip(GrRenderTargetProxy*, const GrFixedClip&, bool insideStencilMask); + void clearStencilClip(const GrFixedClip&, bool insideStencilMask); /** - * Discards the contents render target. nullptr indicates that the current render target should - * be discarded. + * Discards the contents render target. */ // TODO: This should be removed in the future to favor using the load and store ops for discard - virtual void discard(GrRenderTargetProxy*) = 0; + virtual void discard() = 0; - virtual void insertEventMarker(GrRenderTargetProxy*, const char*) = 0; + virtual void insertEventMarker(const char*) = 0; + +protected: + GrRenderTarget* fRenderTarget; + GrSurfaceOrigin fOrigin; private: virtual GrGpu* gpu() = 0; - virtual GrRenderTarget* renderTarget() = 0; virtual void onSubmit() = 0; @@ -117,11 +115,9 @@ private: const SkRect& bounds) = 0; // overridden by backend-specific derived class to perform the clear. - virtual void onClear(GrRenderTargetProxy*, const GrFixedClip&, GrColor) = 0; - - virtual void onClearStencilClip(GrRenderTargetProxy*, const GrFixedClip&, - bool insideStencilMask) = 0; + virtual void onClear(const GrFixedClip&, GrColor) = 0; + virtual void onClearStencilClip(const GrFixedClip&, bool insideStencilMask) = 0; }; #endif |