aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkClipStack.h12
-rw-r--r--src/core/SkCanvas.cpp17
-rw-r--r--src/core/SkClipStack.cpp12
3 files changed, 23 insertions, 18 deletions
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h
index 0896db4284..a23ef4a5a5 100644
--- a/include/core/SkClipStack.h
+++ b/include/core/SkClipStack.h
@@ -229,17 +229,7 @@ public:
void initPath(int saveCount, const SkPath& path, SkRegion::Op op, bool doAA);
- void setEmpty() {
- fType = kEmpty_Type;
- fFiniteBound.setEmpty();
- fFiniteBoundType = kNormal_BoundsType;
- fIsIntersectionOfRects = false;
- fRect.setEmpty();
- fRRect.setEmpty();
- fPath.reset();
- fGenID = kEmptyGenID;
- SkDEBUGCODE(this->checkEmpty();)
- }
+ void setEmpty();
// All Element methods below are only used within SkClipStack.cpp
inline void checkEmpty() const;
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 2cc504fb55..7025e53eb1 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1417,13 +1417,6 @@ void SkCanvas::validateClip() const {
const SkClipStack::Element* element;
while ((element = iter.next()) != NULL) {
switch (element->getType()) {
- case SkClipStack::Element::kPath_Type:
- clipPathHelper(this,
- &tmpClip,
- element->getPath(),
- element->getOp(),
- element->isAA());
- break;
case SkClipStack::Element::kRect_Type:
element->getRect().round(&ir);
tmpClip.op(ir, element->getOp());
@@ -1431,6 +1424,16 @@ void SkCanvas::validateClip() const {
case SkClipStack::Element::kEmpty_Type:
tmpClip.setEmpty();
break;
+ default: {
+ SkPath path;
+ element->asPath(&path);
+ clipPathHelper(this,
+ &tmpClip,
+ path,
+ element->getOp(),
+ element->isAA());
+ break;
+ }
}
}
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 17eb6f931d..e5016977c9 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -103,6 +103,18 @@ void SkClipStack::Element::asPath(SkPath* path) const {
}
}
+void SkClipStack::Element::setEmpty() {
+ fType = kEmpty_Type;
+ fFiniteBound.setEmpty();
+ fFiniteBoundType = kNormal_BoundsType;
+ fIsIntersectionOfRects = false;
+ fRect.setEmpty();
+ fRRect.setEmpty();
+ fPath.reset();
+ fGenID = kEmptyGenID;
+ SkDEBUGCODE(this->checkEmpty();)
+}
+
void SkClipStack::Element::checkEmpty() const {
SkASSERT(fFiniteBound.isEmpty());
SkASSERT(kNormal_BoundsType == fFiniteBoundType);