Fix crash when buidling with no deferred drawing in grcontext
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 25 Jun 2012 18:41:04 +0000 (18:41 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 25 Jun 2012 18:41:04 +0000 (18:41 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@4329 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrContext.cpp

index e157a8a..40921ea 100644 (file)
@@ -1792,8 +1792,10 @@ void GrContext::setupDrawBuffer() {
 #if BATCH_RECT_TO_RECT
     fDrawBuffer->setQuadIndexBuffer(this->getQuadIndexBuffer());
 #endif
-    fDrawBuffer->setAutoFlushTarget(fGpu);
-    fDrawBuffer->setDrawState(fDrawState);
+    if (fDrawBuffer) {
+        fDrawBuffer->setAutoFlushTarget(fGpu);
+        fDrawBuffer->setDrawState(fDrawState);
+    }
 }
 
 GrDrawTarget* GrContext::getTextTarget(const GrPaint& paint) {