don't draw unpremul alpha (yet)

without these early exits, we can treat unpremul colors as premul, generating asserts and wacky colors.

TBR=

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/386203002
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 48962cf..f8ab8ab 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -481,6 +481,8 @@
 
     ///////////////////////////////////////////////////////////////////////
 
+    const SkAlphaType at = fBitmap->alphaType();
+
     // No need to do this if we're doing HQ sampling; if filter quality is
     // still set to HQ by the time we get here, then we must have installed
     // the shader procs above and can skip all this.
@@ -500,15 +502,24 @@
         // bits 3,4,5 encoding the source bitmap format
         switch (fBitmap->colorType()) {
             case kN32_SkColorType:
+                if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                    return false;
+                }
                 index |= 0;
                 break;
             case kRGB_565_SkColorType:
                 index |= 8;
                 break;
             case kIndex_8_SkColorType:
+                if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                    return false;
+                }
                 index |= 16;
                 break;
             case kARGB_4444_SkColorType:
+                if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                    return false;
+                }
                 index |= 24;
                 break;
             case kAlpha_8_SkColorType:
diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp
index 1ba3ee2..3d1d28d 100644
--- a/src/core/SkSpriteBlitter_RGB16.cpp
+++ b/src/core/SkSpriteBlitter_RGB16.cpp
@@ -321,15 +321,23 @@
         return NULL;
     }
 
+    const SkAlphaType at = source.alphaType();
+
     SkSpriteBlitter* blitter = NULL;
     unsigned alpha = paint.getAlpha();
 
     switch (source.colorType()) {
         case kN32_SkColorType: {
+            if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                break;
+            }
             blitter = allocator->createT<Sprite_D16_S32_BlitRowProc>(source);
             break;
         }
         case kARGB_4444_SkColorType:
+            if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                break;
+            }
             if (255 == alpha) {
                 blitter = allocator->createT<Sprite_D16_S4444_Opaque>(source);
             } else {
@@ -344,6 +352,9 @@
             }
             break;
         case kIndex_8_SkColorType:
+            if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) {
+                break;
+            }
             if (paint.isDither()) {
                 // we don't support dither yet in these special cases
                 break;