Index: src/core/SkSpriteBlitter_RGB16.cpp |
diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp |
index 1ba3ee22fcbaae8a4271963f6c3844c7317e6721..3d1d28d0a570dff72b5f26998104f1b024d751c2 100644 |
--- a/src/core/SkSpriteBlitter_RGB16.cpp |
+++ b/src/core/SkSpriteBlitter_RGB16.cpp |
@@ -321,15 +321,23 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPain |
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 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPain |
} |
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; |