aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrFixedClip.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-07-02 09:00:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-02 13:46:30 +0000
commita219419c9d76432dca74494b611ff1f59086d139 (patch)
treee6e5d964b27c4d4656ed1e912700796ad1fff441 /src/gpu/GrFixedClip.cpp
parent00d2e8ebcb13c388339ff1cfbd202fff9589e77a (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.cpp')
-rw-r--r--src/gpu/GrFixedClip.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/GrFixedClip.cpp b/src/gpu/GrFixedClip.cpp
index 94a89fd034..7eee3941f2 100644
--- a/src/gpu/GrFixedClip.cpp
+++ b/src/gpu/GrFixedClip.cpp
@@ -14,12 +14,13 @@ bool GrFixedClip::quickContains(const SkRect& rect) const {
if (fWindowRectsState.enabled()) {
return false;
}
- return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect(), rect);
+ return fScissorState.scissorTest() == GrScissorTest::kDisabled ||
+ GrClip::IsInsideClip(fScissorState.rect(), rect);
}
void GrFixedClip::getConservativeBounds(int w, int h, SkIRect* devResult, bool* iior) const {
devResult->setXYWH(0, 0, w, h);
- if (fScissorState.enabled()) {
+ if (fScissorState.scissorTest() == GrScissorTest::kEnabled) {
if (!devResult->intersect(fScissorState.rect())) {
devResult->setEmpty();
}
@@ -33,7 +34,7 @@ bool GrFixedClip::isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA* aa) const {
if (fWindowRectsState.enabled()) {
return false;
}
- if (fScissorState.enabled()) {
+ if (fScissorState.scissorTest() == GrScissorTest::kEnabled) {
SkRect rect = SkRect::Make(fScissorState.rect());
if (!rect.intersects(rtBounds)) {
return false;
@@ -46,7 +47,7 @@ bool GrFixedClip::isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA* aa) const {
};
bool GrFixedClip::apply(int rtWidth, int rtHeight, GrAppliedHardClip* out, SkRect* bounds) const {
- if (fScissorState.enabled()) {
+ if (fScissorState.scissorTest() == GrScissorTest::kEnabled) {
SkIRect tightScissor = SkIRect::MakeWH(rtWidth, rtHeight);
if (!tightScissor.intersect(fScissorState.rect())) {
return false;