Fix a crash.
authorscroggo <scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 23 Mar 2011 15:04:26 +0000 (15:04 +0000)
committerscroggo <scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 23 Mar 2011 15:04:26 +0000 (15:04 +0000)
http://codereview.appspot.com/4272065/

git-svn-id: http://skia.googlecode.com/svn/trunk@986 2bbb7eff-a529-9590-31e7-b0007b416f81

include/gpu/SkGr.h
src/gpu/SkGr.cpp

index 7221213b5e6740f091b41d40c59bcca9ea5d77f0..223923bfaefce23b931331d98289eece761aee8e 100644 (file)
@@ -207,7 +207,11 @@ public:
     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() {
index e57f88aa2ab223c7854dc447db892d8e67b92fa0..ec4fc1d4414aae46c2ac119e9083a0ea1811e223 100644 (file)
@@ -166,10 +166,9 @@ void SkGrClipIterator::reset(const SkClipStack& clipStack) {
 
 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;
     }
 }