aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuCommandBuffer.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-28 08:42:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-28 14:07:08 +0000
commit4f101a77a742015ed0fb50154909aa73e54d8fde (patch)
treeb3f9a99963cc08b9a93262e1768eb21adf0cf431 /src/gpu/GrGpuCommandBuffer.cpp
parentf7928b4f33b5e899b4ac543d8d850523cbd1d6da (diff)
Make GrGpuCommandBuffer's methods take a GrRenderTargetProxy (rather than a GrRenderTarget)
In https://skia-review.googlesource.com/c/26363/ (Remove origin field from GrSurface) I just passed an extra GrSurfaceOrigin parameter to all these methods. Besides being verbose this also led to the "discard" method having an origin (to support the GrVkGpuCommandBuffer). It think this approach is better and is plausible if the GrGpuCommandBuffer is viewed as an intermediary between the GrProxy-based Ops and the Gpu. In isolation this CL doesn't really show why we want to percolate the Proxy down. Once GrSurface no longer has an origin a lot of the GrGpu methods need it passed in explicitly. By having the GrGpuCommandBuffer get the proxy it can then pass the origin to GrGpu and removes a layer of functions with an extra origin parameter. Change-Id: Ie223fdee930171a32a5923155a0322e9a9c2aaa9 Reviewed-on: https://skia-review.googlesource.com/27980 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.cpp')
-rw-r--r--src/gpu/GrGpuCommandBuffer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
index fd6c4bdabb..e240068a53 100644
--- a/src/gpu/GrGpuCommandBuffer.cpp
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -21,19 +21,20 @@ void GrGpuCommandBuffer::submit() {
this->onSubmit();
}
-void GrGpuCommandBuffer::clear(GrRenderTarget* rt, const GrFixedClip& clip, GrColor color) {
+void GrGpuCommandBuffer::clear(GrRenderTargetProxy* proxy, const GrFixedClip& clip, GrColor color) {
#ifdef SK_DEBUG
+ GrRenderTarget* rt = proxy->priv().peekRenderTarget();
SkASSERT(rt);
SkASSERT(!clip.scissorEnabled() ||
(SkIRect::MakeWH(rt->width(), rt->height()).contains(clip.scissorRect()) &&
SkIRect::MakeWH(rt->width(), rt->height()) != clip.scissorRect()));
#endif
- this->onClear(rt, clip, color);
+ this->onClear(proxy, clip, color);
}
-void GrGpuCommandBuffer::clearStencilClip(GrRenderTarget* rt, const GrFixedClip& clip,
+void GrGpuCommandBuffer::clearStencilClip(GrRenderTargetProxy* proxy, const GrFixedClip& clip,
bool insideStencilMask) {
- this->onClearStencilClip(rt, clip, insideStencilMask);
+ this->onClearStencilClip(proxy, clip, insideStencilMask);
}
bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline,