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/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 6b51ca2..03a68dd 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -800,6 +800,15 @@
         }
     }
 #endif
+    if (NULL == this->getRenderTarget()) {
+        return false;
+    }
+    if (GrPixelConfigIsUnpremultiplied(this->getRenderTarget()->config())) {
+        if (kOne_BlendCoeff != fCurrDrawState.fSrcBlend ||
+            kZero_BlendCoeff != fCurrDrawState.fDstBlend) {
+            return false;
+        }
+    }
     for (int s = 0; s < GrDrawState::kNumStages; ++s) {
         if (this->isStageEnabled(s) &&
             GrPixelConfigIsUnpremultiplied(fCurrDrawState.fTextures[s]->config())) {