Fix Unpremul Index8 tests
authormsarett <msarett@google.com>
Wed, 3 Feb 2016 23:31:18 +0000 (15:31 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Feb 2016 23:31:18 +0000 (15:31 -0800)
TBR=scroggo@google.com

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1663323002

Review URL: https://codereview.chromium.org/1663323002

dm/DMSrcSink.cpp

index 7a260e5..9576f69 100644 (file)
@@ -282,6 +282,10 @@ void premultiply_if_necessary(SkBitmap& bitmap) {
             // No need to premultiply kGray or k565 outputs.
             break;
     }
+
+    // In the kIndex_8 case, the canvas won't even try to draw unless we mark the
+    // bitmap as kPremul.
+    bitmap.setAlphaType(kPremul_SkAlphaType);
 }
 
 bool get_decode_info(SkImageInfo* decodeInfo, SkColorType canvasColorType,