Fix another clipstack element !rect doesn't mean path bug.

BUG=skia:2183
R=robertphillips@google.com
TBR=robertphillips@google.com

Author: bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13481 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-02-17 19:50:02 +00:00
parent 2c56cb858f
commit 5c05639925

View File

@ -1021,24 +1021,10 @@ GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID,
helper.draw(temp, SkRegion::kXOR_Op, false, 0xFF); helper.draw(temp, SkRegion::kXOR_Op, false, 0xFF);
} }
if (Element::kRect_Type == element->getType()) { SkPath clipPath;
// convert the rect to a path so we can invert the fill element->asPath(&clipPath);
SkPath temp; clipPath.toggleInverseFillType();
temp.addRect(element->getRect()); helper.draw(clipPath, stroke, SkRegion::kReplace_Op, element->isAA(), 0x00);
temp.setFillType(SkPath::kInverseEvenOdd_FillType);
helper.draw(temp, stroke, SkRegion::kReplace_Op,
element->isAA(),
0x00);
} else {
SkASSERT(Element::kPath_Type == element->getType());
SkPath clipPath = element->getPath();
clipPath.toggleInverseFillType();
helper.draw(clipPath, stroke,
SkRegion::kReplace_Op,
element->isAA(),
0x00);
}
continue; continue;
} }
@ -1048,8 +1034,9 @@ GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID,
if (Element::kRect_Type == element->getType()) { if (Element::kRect_Type == element->getType()) {
helper.draw(element->getRect(), op, element->isAA(), 0xFF); helper.draw(element->getRect(), op, element->isAA(), 0xFF);
} else { } else {
SkASSERT(Element::kPath_Type == element->getType()); SkPath path;
helper.draw(element->getPath(), stroke, op, element->isAA(), 0xFF); element->asPath(&path);
helper.draw(path, stroke, op, element->isAA(), 0xFF);
} }
} }