| Index: src/gpu/GrReducedClip.cpp
|
| diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
|
| index 132936c64e0c811e422279c8aa9967336fe1146d..8de96e86d8888d363d863146845ee031bf6e3817 100644
|
| --- a/src/gpu/GrReducedClip.cpp
|
| +++ b/src/gpu/GrReducedClip.cpp
|
| @@ -346,6 +346,7 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
|
| fHasIBounds = false;
|
|
|
| if (stack.isWideOpen()) {
|
| + fGenID = SkClipStack::kWideOpenGenID;
|
| fInitialState = InitialState::kAllIn;
|
| return;
|
| }
|
| @@ -356,26 +357,37 @@ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds
|
| stack.getBounds(&stackBounds, &stackBoundsType, &iior);
|
|
|
| if (stackBounds.isEmpty() || GrClip::IsOutsideClip(stackBounds, queryBounds)) {
|
| - bool insideOut = SkClipStack::kInsideOut_BoundsType == stackBoundsType;
|
| - fInitialState = insideOut ? InitialState::kAllIn : InitialState::kAllOut;
|
| + if (SkClipStack::kInsideOut_BoundsType == stackBoundsType) {
|
| + fGenID = SkClipStack::kWideOpenGenID;
|
| + fInitialState = InitialState::kAllIn;
|
| + } else {
|
| + fGenID = SkClipStack::kEmptyGenID;
|
| + fInitialState = InitialState::kAllOut;
|
| + }
|
| return;
|
| }
|
|
|
| if (iior) {
|
| // "Is intersection of rects" means the clip is a single rect indicated by the stack bounds.
|
| - // This should only be true if aa/non-aa status matches among all elements.
|
| SkASSERT(SkClipStack::kNormal_BoundsType == stackBoundsType);
|
| + if (GrClip::IsInsideClip(stackBounds, queryBounds)) {
|
| + fGenID = SkClipStack::kWideOpenGenID;
|
| + fInitialState = InitialState::kAllIn;
|
| + return;
|
| + }
|
| + // iior should only be true if aa/non-aa status matches among all elements.
|
| SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart);
|
| if (!iter.prev()->isAA() || GrClip::IsPixelAligned(stackBounds)) {
|
| // The clip is a non-aa rect. This is the one spot where we can actually implement the
|
| // clip (using fIBounds) rather than just telling the caller what it should be.
|
| stackBounds.round(&fIBounds);
|
| - fHasIBounds = true;
|
| - fInitialState = fIBounds.isEmpty() ? InitialState::kAllOut : InitialState::kAllIn;
|
| - return;
|
| - }
|
| - if (GrClip::IsInsideClip(stackBounds, queryBounds)) {
|
| - fInitialState = InitialState::kAllIn;
|
| + if (fIBounds.isEmpty()) {
|
| + fGenID = SkClipStack::kEmptyGenID;
|
| + fInitialState = InitialState::kAllOut;
|
| + } else {
|
| + fHasIBounds = true;
|
| + fInitialState = InitialState::kAllIn;
|
| + }
|
| return;
|
| }
|
|
|
|
|