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; |