diff options
author | csmartdalton <csmartdalton@google.com> | 2016-08-31 11:55:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-31 11:55:52 -0700 |
commit | 29df76096fd30941086324902a82656df2d8becd (patch) | |
tree | 37740539e50fcdc09d694bc39e98e55aa26cf3f4 /src/gpu/GrGpuCommandBuffer.cpp | |
parent | dc43898bbbd06202562514ae785116e0cc40f825 (diff) |
Define clear regions in terms of GrFixedClip
Updates clear APIs to take GrFixedClip instead of a rectangle. This
will allow us to use window rectangles with clears. Removes stencil
knobs from GrFixedClip.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2262473003
Review-Url: https://codereview.chromium.org/2262473003
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.cpp')
-rw-r--r-- | src/gpu/GrGpuCommandBuffer.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp index af0993e033..022c16696f 100644 --- a/src/gpu/GrGpuCommandBuffer.cpp +++ b/src/gpu/GrGpuCommandBuffer.cpp @@ -8,6 +8,7 @@ #include "GrGpuCommandBuffer.h" #include "GrCaps.h" +#include "GrFixedClip.h" #include "GrGpu.h" #include "GrPrimitiveProcessor.h" #include "GrRenderTarget.h" @@ -18,17 +19,19 @@ void GrGpuCommandBuffer::submit(const SkIRect& bounds) { this->onSubmit(bounds); } -void GrGpuCommandBuffer::clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget) { - SkASSERT(renderTarget); - SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).contains(rect)); - this->onClear(renderTarget, rect, color); +void GrGpuCommandBuffer::clear(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) { + SkASSERT(rt); + SkASSERT(!clip.scissorEnabled() || + (SkIRect::MakeWH(rt->width(), rt->height()).contains(clip.scissorRect()) && + SkIRect::MakeWH(rt->width(), rt->height()) != clip.scissorRect())); + this->onClear(rt, clip, color); } -void GrGpuCommandBuffer::clearStencilClip(const SkIRect& rect, - bool insideClip, - GrRenderTarget* renderTarget) { - SkASSERT(renderTarget); - this->onClearStencilClip(renderTarget, rect, insideClip); +void GrGpuCommandBuffer::clearStencilClip(const GrFixedClip& clip, + bool insideStencilMask, + GrRenderTarget* rt) { + SkASSERT(rt); + this->onClearStencilClip(rt, clip, insideStencilMask); } |