Turn clear-to-white-then-intersect clips into clear-to-black-then-replace

R=robertphillips@google.com, brian@thesalomons.net

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/27170003

git-svn-id: http://skia.googlecode.com/svn/trunk@11786 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-10-15 20:04:07 +00:00
parent a46128ee54
commit db62709fc1

View File

@ -355,7 +355,13 @@ void reduced_stack_walker(const SkClipStack& stack,
break;
case SkRegion::kIntersect_Op:
// intersecting with the empty set yields the empty set
skippable = kAllOut_InitialState == *initialState;
if (kAllOut_InitialState == *initialState) {
skippable = true;
} else {
// We can clear to zero and then simply draw the clip element.
*initialState = kAllOut_InitialState;
element->setOp(SkRegion::kReplace_Op);
}
break;
case SkRegion::kUnion_Op:
if (kAllIn_InitialState == *initialState) {