Fix a crash.
http://codereview.appspot.com/4272065/
git-svn-id: http://skia.googlecode.com/svn/trunk@986 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 7221213..223923b 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -207,7 +207,11 @@
virtual GrSetOp getOp() const;
virtual void getRect(GrRect* rect) const {
- *rect = Sk2Gr(*fCurr->fRect);
+ if (!fCurr->fRect) {
+ rect->setEmpty();
+ } else {
+ *rect = Sk2Gr(*fCurr->fRect);
+ }
}
virtual GrPathIter* getPathIter() {
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index e57f88a..ec4fc1d 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -166,10 +166,9 @@
GrClipType SkGrClipIterator::getType() const {
GrAssert(!this->isDone());
- if (NULL != fCurr->fRect) {
+ if (NULL == fCurr->fPath) {
return kRect_ClipType;
} else {
- GrAssert(NULL != fCurr->fPath);
return kPath_ClipType;
}
}