diff options
author | 2015-02-25 13:04:43 -0800 | |
---|---|---|
committer | 2015-02-25 13:04:44 -0800 | |
commit | 2907059d0eb1972a300ea1bf0cd4e4febabb9784 (patch) | |
tree | f3f565626302891f0b74b870972ae2a4db89df4c /src/gpu/GrClipMaskManager.cpp | |
parent | edeccc58606e0421a1ae275e391ee4347c6f52f6 (diff) |
Revert of Pass clip to context (patchset #8 id:180001 of https://codereview.chromium.org/936943002/)
Reason for revert:
Strange blur problems on nexus 5
Original issue's description:
> I'd really like to land this before the branch so speedy reviews are appreciated.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336
TBR=jvanverth@google.com,senorblanco@google.com,bsalomon@google.com,senorblanco@chromium.org,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/956083002
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 99c74e3c3f..b28b75cefb 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -231,47 +231,29 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder, bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds); if (!ignoreClip) { // The clip mask manager always draws with a single IRect so we special case that logic here - // Image filters just use a rect, so we also special case that logic - switch (clip.clipType()) { - case GrClip::kWideOpen_ClipType: - // we should have handled this case above - SkASSERT(false); - case GrClip::kIRect_ClipType: { - initialState = GrReducedClip::kAllIn_InitialState; - clipSpaceIBounds = clip.irect(); - SkNEW_INSERT_AT_LLIST_HEAD(&elements, - Element, - (SkRect::Make(clipSpaceIBounds), - SkRegion::kIntersect_Op, false)); - } break; - case GrClip::kRect_ClipType: { - initialState = GrReducedClip::kAllIn_InitialState; - clipSpaceIBounds.setLTRB(SkScalarCeilToInt(clip.rect().fLeft), - SkScalarCeilToInt(clip.rect().fTop), - SkScalarCeilToInt(clip.rect().fRight), - SkScalarCeilToInt(clip.rect().fBottom)); - SkNEW_INSERT_AT_LLIST_HEAD(&elements, - Element, - (SkRect::Make(clipSpaceIBounds), - SkRegion::kIntersect_Op, false)); - } break; - case GrClip::kClipStack_ClipType: { - clipSpaceRTIBounds.offset(clip.origin()); - GrReducedClip::ReduceClipStack(*clip.clipStack(), - clipSpaceRTIBounds, - &elements, - &genID, - &initialState, - &clipSpaceIBounds, - &requiresAA); - if (elements.isEmpty()) { - if (GrReducedClip::kAllIn_InitialState == initialState) { - ignoreClip = clipSpaceIBounds == clipSpaceRTIBounds; - } else { - return false; - } + if (GrClip::kIRect_ClipType == clip.clipType()) { + initialState = GrReducedClip::kAllIn_InitialState; + clipSpaceIBounds = clip.irect(); + SkNEW_INSERT_AT_LLIST_HEAD(&elements, + Element, + (SkRect::Make(clipSpaceIBounds), + SkRegion::kIntersect_Op, false)); + } else { + clipSpaceRTIBounds.offset(clip.origin()); + GrReducedClip::ReduceClipStack(*clip.clipStack(), + clipSpaceRTIBounds, + &elements, + &genID, + &initialState, + &clipSpaceIBounds, + &requiresAA); + if (elements.isEmpty()) { + if (GrReducedClip::kAllIn_InitialState == initialState) { + ignoreClip = clipSpaceIBounds == clipSpaceRTIBounds; + } else { + return false; } - } break; + } } } |