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

Unified Diff: src/core/SkCanvas.cpp

Issue 163683002: Store SkRRects in SkClipStack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix unhandled enum value warning in unit test 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 | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 61acf269b46c4d05de972e9d89eec0aa68250d7b..2cc504fb55bc64c4ee1fc24d08430882dee82e16 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1295,13 +1295,7 @@ bool SkCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
continue;
}
SkPath operand;
- if (type == SkClipStack::Element::kRect_Type) {
- operand.addRect(element->getRect());
- } else if (type == SkClipStack::Element::kPath_Type) {
- operand = element->getPath();
- } else {
- SkDEBUGFAIL("Unexpected type.");
- }
+ element->asPath(&operand);
SkRegion::Op elementOp = element->getOp();
if (elementOp == SkRegion::kReplace_Op) {
devPath = operand;
@@ -1458,6 +1452,9 @@ void SkCanvas::replayClips(ClipVisitor* visitor) const {
case SkClipStack::Element::kPath_Type:
visitor->clipPath(element->getPath(), element->getOp(), element->isAA());
break;
+ case SkClipStack::Element::kRRect_Type:
+ visitor->clipRRect(element->getRRect(), element->getOp(), element->isAA());
+ break;
case SkClipStack::Element::kRect_Type:
visitor->clipRect(element->getRect(), element->getOp(), element->isAA());
break;
« no previous file with comments | « include/core/SkClipStack.h ('k') | src/core/SkClipStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698