diff options
author | 2018-07-02 14:08:49 +0000 | |
---|---|---|
committer | 2018-07-02 14:09:01 +0000 | |
commit | d818ebf4a31724aa93fd439a2ac4195f69ae3af0 (patch) | |
tree | 28b49c892741fe114f6d99a1f2fb15fac3251133 /src/gpu/ops | |
parent | 068025e39ca5131b598805d5f1513cc18ae15dea (diff) |
Revert "Some scissor state cleanup."
This reverts commit a219419c9d76432dca74494b611ff1f59086d139.
Reason for revert: breaking things
Original change's description:
> 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>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: If71a5c5efc86d4239b40675bad2a6cb1f77460f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r-- | src/gpu/ops/GrClearOp.cpp | 11 | ||||
-rw-r--r-- | src/gpu/ops/GrClearOp.h | 10 | ||||
-rw-r--r-- | src/gpu/ops/GrClearStencilClipOp.h | 8 | ||||
-rw-r--r-- | src/gpu/ops/GrStencilAndCoverPathRenderer.cpp | 2 |
4 files changed, 13 insertions, 18 deletions
diff --git a/src/gpu/ops/GrClearOp.cpp b/src/gpu/ops/GrClearOp.cpp index 52360dbe93..612ff2085d 100644 --- a/src/gpu/ops/GrClearOp.cpp +++ b/src/gpu/ops/GrClearOp.cpp @@ -17,8 +17,7 @@ std::unique_ptr<GrClearOp> GrClearOp::Make(GrContext* context, GrColor color, GrSurfaceProxy* dstProxy) { const SkIRect rect = SkIRect::MakeWH(dstProxy->width(), dstProxy->height()); - if (clip.scissorTest() == GrScissorTest::kEnabled && - !SkIRect::Intersects(clip.scissorRect(), rect)) { + if (clip.scissorEnabled() && !SkIRect::Intersects(clip.scissorRect(), rect)) { return nullptr; } @@ -43,7 +42,7 @@ GrClearOp::GrClearOp(const GrFixedClip& clip, GrColor color, GrSurfaceProxy* pro , fClip(clip) , fColor(color) { const SkIRect rtRect = SkIRect::MakeWH(proxy->width(), proxy->height()); - if (fClip.scissorTest() == GrScissorTest::kEnabled) { + if (fClip.scissorEnabled()) { // Don't let scissors extend outside the RT. This may improve op combining. if (!fClip.intersect(rtRect)) { SkASSERT(0); // should be caught upstream @@ -54,10 +53,8 @@ GrClearOp::GrClearOp(const GrFixedClip& clip, GrColor color, GrSurfaceProxy* pro fClip.disableScissor(); } } - this->setBounds( - SkRect::Make(fClip.scissorTest() == GrScissorTest::kEnabled ? fClip.scissorRect() - : rtRect), - HasAABloat::kNo, IsZeroArea::kNo); + this->setBounds(SkRect::Make(fClip.scissorEnabled() ? fClip.scissorRect() : rtRect), + HasAABloat::kNo, IsZeroArea::kNo); } void GrClearOp::onExecute(GrOpFlushState* state) { diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h index 59929b269a..6e76191dff 100644 --- a/src/gpu/ops/GrClearOp.h +++ b/src/gpu/ops/GrClearOp.h @@ -33,7 +33,7 @@ public: SkString string; string.append(INHERITED::dumpInfo()); string.appendf("Scissor [ "); - if (fClip.scissorTest() == GrScissorTest::kEnabled) { + if (fClip.scissorEnabled()) { const SkIRect& r = fClip.scissorRect(); string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom); } else { @@ -83,11 +83,9 @@ private: bool contains(const GrClearOp* that) const { // The constructor ensures that scissor gets disabled on any clip that fills the entire RT. - if (fClip.scissorTest() == GrScissorTest::kDisabled) { - return true; - } - return that->fClip.scissorTest() == GrScissorTest::kEnabled && - fClip.scissorRect().contains(that->fClip.scissorRect()); + return !fClip.scissorEnabled() || + (that->fClip.scissorEnabled() && + fClip.scissorRect().contains(that->fClip.scissorRect())); } void onPrepare(GrOpFlushState*) override {} diff --git a/src/gpu/ops/GrClearStencilClipOp.h b/src/gpu/ops/GrClearStencilClipOp.h index 09c05e1ceb..3e7ad5070f 100644 --- a/src/gpu/ops/GrClearStencilClipOp.h +++ b/src/gpu/ops/GrClearStencilClipOp.h @@ -27,7 +27,7 @@ public: SkString dumpInfo() const override { SkString string("Scissor ["); - if (fClip.scissorTest() == GrScissorTest::kEnabled) { + if (fClip.scissorEnabled()) { const SkIRect& r = fClip.scissorRect(); string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom); } else { @@ -46,9 +46,9 @@ private: : INHERITED(ClassID()) , fClip(clip) , fInsideStencilMask(insideStencilMask) { - const SkRect& bounds = fClip.scissorTest() == GrScissorTest::kEnabled - ? SkRect::Make(fClip.scissorRect()) - : SkRect::MakeIWH(proxy->width(), proxy->height()); + const SkRect& bounds = fClip.scissorEnabled() + ? SkRect::Make(fClip.scissorRect()) + : SkRect::MakeIWH(proxy->width(), proxy->height()); this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); } diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp index 6b56183752..f395927b63 100644 --- a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp @@ -109,7 +109,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) { return true; } GrStencilClip stencilClip(appliedClip.stencilStackID()); - if (appliedClip.scissorState().scissorTest() == GrScissorTest::kEnabled) { + if (appliedClip.scissorState().enabled()) { stencilClip.fixedClip().setScissor(appliedClip.scissorState().rect()); } if (appliedClip.windowRectsState().enabled()) { |