Add assert to catch circular drawing higher up the call stack.



git-svn-id: http://skia.googlecode.com/svn/trunk@3559 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 730450b..3e3ff51 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -771,6 +771,14 @@
             GrCrash("Index reads outside valid index range.");
         }
     }
+
+    GrAssert(NULL != this->getDrawState().getRenderTarget());
+    for (int i = 0; i < GrDrawState::kNumStages; ++i) {
+        if (this->getDrawState().getTexture(i)) {
+            GrAssert(this->getDrawState().getTexture(i)->asRenderTarget() != 
+                     this->getDrawState().getRenderTarget());
+        }
+    }
 #endif
     const GrDrawState& drawState = this->getDrawState();
     if (NULL == drawState.getRenderTarget()) {