diff options
author | Brian Salomon <bsalomon@google.com> | 2018-07-02 09:00:27 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-02 13:46:30 +0000 |
commit | a219419c9d76432dca74494b611ff1f59086d139 (patch) | |
tree | e6e5d964b27c4d4656ed1e912700796ad1fff441 /src/gpu/GrFixedClip.h | |
parent | 00d2e8ebcb13c388339ff1cfbd202fff9589e77a (diff) |
Some scissor state cleanup.
Separate flushing the enablement of scissor from the rect in GrGLGpu.
Move GrPipeline::ScissorState to a global enum and use more broadly.
Rename to GrScissorTest to avoid name conflict with existing
GrScissorState.
Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
Reviewed-on: https://skia-review.googlesource.com/137395
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrFixedClip.h')
-rw-r--r-- | src/gpu/GrFixedClip.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/GrFixedClip.h b/src/gpu/GrFixedClip.h index d44c1e84e4..2e466aff67 100644 --- a/src/gpu/GrFixedClip.h +++ b/src/gpu/GrFixedClip.h @@ -21,14 +21,15 @@ public: explicit GrFixedClip(const SkIRect& scissorRect) : fScissorState(scissorRect) {} const GrScissorState& scissorState() const { return fScissorState; } - bool scissorEnabled() const { return fScissorState.enabled(); } - const SkIRect& scissorRect() const { SkASSERT(scissorEnabled()); return fScissorState.rect(); } + GrScissorTest scissorTest() const { return fScissorState.scissorTest(); } + const SkIRect& scissorRect() const { + SkASSERT(this->scissorTest() == GrScissorTest::kEnabled); + return fScissorState.rect(); + } void disableScissor() { fScissorState.setDisabled(); } - void setScissor(const SkIRect& irect) { - fScissorState.set(irect); - } + void setScissor(const SkIRect& irect) { fScissorState = GrScissorState(irect); } bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& irect) { return fScissorState.intersect(irect); } |