Filter out draws to non-PMA configs that won't blend correctly
Review URL: http://codereview.appspot.com/5376059/
git-svn-id: http://skia.googlecode.com/svn/trunk@2665 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 2753cf0..1baf42e 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -230,6 +230,9 @@
}
void GrGpu::clear(const GrIRect* rect, GrColor color) {
+ if (NULL == this->getRenderTarget()) {
+ return;
+ }
this->handleDirtyContext();
this->onClear(rect, color);
}
@@ -516,13 +519,8 @@
const GrIRect* r = NULL;
GrIRect clipRect;
- // we check this early because we need a valid
- // render target to setup stencil clipping
- // before even going into flushGraphicsState
- if (NULL == fCurrDrawState.fRenderTarget) {
- GrAssert(!"No render target bound.");
- return false;
- }
+ // GrDrawTarget should have filtered this for us
+ GrAssert(NULL != fCurrDrawState.fRenderTarget);
if (fCurrDrawState.fFlagBits & kClip_StateBit) {
GrRenderTarget& rt = *fCurrDrawState.fRenderTarget;