Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 169763002: Fix another clipstack element !rect doesn't mean path bug. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: another spot in same function Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 8a7aac247aaaf8ea45ff892c6391eac97d7406a8..7ccf30f547a8bc85dfc44f84fc1a9dec6cc713eb 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -1021,24 +1021,10 @@ GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID,
helper.draw(temp, SkRegion::kXOR_Op, false, 0xFF);
}
- if (Element::kRect_Type == element->getType()) {
- // convert the rect to a path so we can invert the fill
- SkPath temp;
- temp.addRect(element->getRect());
- 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);
- }
+ SkPath clipPath;
+ element->asPath(&clipPath);
+ clipPath.toggleInverseFillType();
+ helper.draw(clipPath, stroke, SkRegion::kReplace_Op, element->isAA(), 0x00);
continue;
}
@@ -1048,8 +1034,9 @@ GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID,
if (Element::kRect_Type == element->getType()) {
helper.draw(element->getRect(), op, element->isAA(), 0xFF);
} else {
- SkASSERT(Element::kPath_Type == element->getType());
- helper.draw(element->getPath(), stroke, op, element->isAA(), 0xFF);
+ SkPath path;
+ element->asPath(&path);
+ helper.draw(path, stroke, op, element->isAA(), 0xFF);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698