diff options
author | 2016-10-12 09:47:22 -0400 | |
---|---|---|
committer | 2016-10-12 14:20:58 +0000 | |
commit | 65a09274184ffd25d446352a96d3890ea7e625fa (patch) | |
tree | c8c5669c4079c3768e2544884162cbd54ef20472 /src/gpu/gl | |
parent | fe2965af79d70c7f3fe30204846e430c3db56a4e (diff) |
Don't pass in RT to individual Gpu CommandBuffer calls
The Vulkan backend already stored a GrVkRT, but was inconsistent
in sometimes using the stored value and sometimes the passed in
value (though they should be the same). This just cleans up the
code so that everyone uses a stored RT.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3126
Change-Id: I571de4bfb1da612d61171321d5224a9a19d8e545
Reviewed-on: https://skia-review.googlesource.com/3126
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpuCommandBuffer.h | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 8c0373ac28..56f01ed018 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2642,7 +2642,7 @@ GrGpuCommandBuffer* GrGLGpu::createCommandBuffer( GrRenderTarget* target, const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo, const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) { - return new GrGLGpuCommandBuffer(this); + return new GrGLGpuCommandBuffer(this, static_cast<GrGLRenderTarget*>(target)); } void GrGLGpu::finishDrawTarget() { diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h index 4ad2b13ada..0c9ddc2ba4 100644 --- a/src/gpu/gl/GrGLGpuCommandBuffer.h +++ b/src/gpu/gl/GrGLGpuCommandBuffer.h @@ -12,6 +12,8 @@ #include "GrGLGpu.h" +class GrGLRenderTarget; + class GrGLGpuCommandBuffer : public GrGpuCommandBuffer { /** * We do not actually buffer up draws or do any work in the this class for GL. Instead commands @@ -19,16 +21,17 @@ class GrGLGpuCommandBuffer : public GrGpuCommandBuffer { * pass through functions to corresponding calls in the GrGLGpu class. */ public: - GrGLGpuCommandBuffer(GrGLGpu* gpu) : fGpu(gpu) {} + GrGLGpuCommandBuffer(GrGLGpu* gpu, GrGLRenderTarget* rt) : fGpu(gpu), fRenderTarget(rt) {} virtual ~GrGLGpuCommandBuffer() {} void end() override {} - void discard(GrRenderTarget* rt) override {} + void discard() override {} private: GrGpu* gpu() override { return fGpu; } + GrRenderTarget* renderTarget() override { return fRenderTarget; } void onSubmit(const SkIRect& bounds) override {} @@ -39,17 +42,17 @@ private: fGpu->draw(pipeline, primProc, mesh, meshCount); } - void onClear(GrRenderTarget* rt, const GrFixedClip& clip, GrColor color) override { - fGpu->clear(clip, color, rt); + void onClear(const GrFixedClip& clip, GrColor color) override { + fGpu->clear(clip, color, fRenderTarget); } - void onClearStencilClip(GrRenderTarget* rt, - const GrFixedClip& clip, + void onClearStencilClip(const GrFixedClip& clip, bool insideStencilMask) override { - fGpu->clearStencilClip(clip, insideStencilMask, rt); + fGpu->clearStencilClip(clip, insideStencilMask, fRenderTarget); } GrGLGpu* fGpu; + GrGLRenderTarget* fRenderTarget; typedef GrGpuCommandBuffer INHERITED; }; |