aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuCommandBuffer.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-30 13:38:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-30 20:17:51 +0000
commitc293a29bc2fced15ac44a66efa813d42cb3f2e0b (patch)
treef1dc394033e8baa97e05a060ca5dc9885224c85c /src/gpu/GrGpuCommandBuffer.h
parentc789b61167dd98efc3c3bfcf9673eef24c2e57f4 (diff)
Make GrGpuCommandBuffer infer its render target from first draw
This is a temporary workaround to allow removal of GrBatch::renderTarget(). Change-Id: Ic14710a369802064cf6446e8191a98ea3595556d Reviewed-on: https://skia-review.googlesource.com/5342 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.h')
-rw-r--r--src/gpu/GrGpuCommandBuffer.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.h b/src/gpu/GrGpuCommandBuffer.h
index ef4f428c9c..f8c938ba64 100644
--- a/src/gpu/GrGpuCommandBuffer.h
+++ b/src/gpu/GrGpuCommandBuffer.h
@@ -26,6 +26,12 @@ struct SkRect;
* the same render target. It is possible that these commands execute immediately (GL), or get
* buffered up for later execution (Vulkan). GrBatches 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:
@@ -72,16 +78,16 @@ public:
/**
* Clear the passed in render target. Ignores the draw state and clip.
*/
- void clear(const GrFixedClip&, GrColor);
+ void clear(GrRenderTarget*, const GrFixedClip&, GrColor);
- void clearStencilClip(const GrFixedClip&, bool insideStencilMask);
+ void clearStencilClip(GrRenderTarget*, const GrFixedClip&, bool insideStencilMask);
/**
* Discards the contents render target. nullptr indicates that the current render target should
* be discarded.
*/
// TODO: This should be removed in the future to favor using the load and store ops for discard
- virtual void discard() = 0;
+ virtual void discard(GrRenderTarget*) = 0;
private:
virtual GrGpu* gpu() = 0;
@@ -97,9 +103,9 @@ private:
const SkRect& bounds) = 0;
// overridden by backend-specific derived class to perform the clear.
- virtual void onClear(const GrFixedClip&, GrColor) = 0;
+ virtual void onClear(GrRenderTarget*, const GrFixedClip&, GrColor) = 0;
- virtual void onClearStencilClip(const GrFixedClip&,
+ virtual void onClearStencilClip(GrRenderTarget*, const GrFixedClip&,
bool insideStencilMask) = 0;
};