diff options
author | 2017-08-09 13:31:36 -0400 | |
---|---|---|
committer | 2017-08-09 18:11:34 +0000 | |
commit | b681a0f1b0acebe36130fd463d14016d48295b97 (patch) | |
tree | b069332fad7ccacb29ed0c080c4d423824ae7e0f /src/gpu/gl/GrGLGpuCommandBuffer.h | |
parent | c270423de16f54af26147280c406b8b74ab07046 (diff) |
Store discard request on the opList and remove GrDiscardOp
Change-Id: Ic1f76bb91c16b23df1fe71c07a4d5ad5abf1dc26
Reviewed-on: https://skia-review.googlesource.com/32640
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpuCommandBuffer.h')
-rw-r--r-- | src/gpu/gl/GrGLGpuCommandBuffer.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h index 0d57337ac1..ddf2382160 100644 --- a/src/gpu/gl/GrGLGpuCommandBuffer.h +++ b/src/gpu/gl/GrGLGpuCommandBuffer.h @@ -25,16 +25,22 @@ class GrGLGpuCommandBuffer : public GrGpuCommandBuffer { */ public: GrGLGpuCommandBuffer(GrGLGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin, + const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo, const GrGpuCommandBuffer::StencilLoadAndStoreInfo& stencilInfo) : INHERITED(rt, origin) - , fGpu(gpu) { - fClearSB = LoadOp::kClear == stencilInfo.fLoadOp; + , fGpu(gpu) + , fColorLoadAndStoreInfo(colorInfo) + , fStencilLoadAndStoreInfo(stencilInfo) { } ~GrGLGpuCommandBuffer() override {} void begin() override { - if (fClearSB) { + if (GrLoadOp::kClear == fColorLoadAndStoreInfo.fLoadOp) { + fGpu->clear(GrFixedClip::Disabled(), fColorLoadAndStoreInfo.fClearColor, + fRenderTarget, fOrigin); + } + if (GrLoadOp::kClear == fStencilLoadAndStoreInfo.fLoadOp) { fGpu->clearStencil(fRenderTarget, 0x0); } } @@ -73,8 +79,9 @@ private: fGpu->clearStencilClip(clip, insideStencilMask, fRenderTarget, fOrigin); } - GrGLGpu* fGpu; - bool fClearSB; + GrGLGpu* fGpu; + GrGpuCommandBuffer::LoadAndStoreInfo fColorLoadAndStoreInfo; + GrGpuCommandBuffer::StencilLoadAndStoreInfo fStencilLoadAndStoreInfo; typedef GrGpuCommandBuffer INHERITED; }; |