Fix bitmap copy gms
authorMatt Sarett <msarett@google.com>
Fri, 28 Apr 2017 20:06:34 +0000 (16:06 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 28 Apr 2017 20:32:44 +0000 (20:32 +0000)
Mark pixels as opaque so copying to 565 continues to work.

Bug: skia:
Change-Id: Id2b0a8c462fe35f7d1cc2ccc32ca10eda18981c8
Reviewed-on: https://skia-review.googlesource.com/14653
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

gm/bitmapcopy.cpp
gm/bitmapfilters.cpp

index 7428c20..64f1136 100644 (file)
@@ -65,7 +65,7 @@ protected:
         SkScalar vertMargin = 10;
 
         SkBitmap src;
-        src.allocN32Pixels(40, 40);
+        src.allocN32Pixels(40, 40, kOpaque_SkAlphaType);
         SkCanvas canvasTmp(src);
 
         draw_checks(&canvasTmp, 40, 40);
index 7dc9692..b99ab10 100644 (file)
@@ -18,7 +18,7 @@ static void make_bm(SkBitmap* bm) {
         colorsPM[i] = SkPreMultiplyColor(colors[i]);
     }
     bm->allocPixels(SkImageInfo::Make(2, 2, kIndex_8_SkColorType,
-                                      kPremul_SkAlphaType),
+                                      kOpaque_SkAlphaType),
                     SkColorTable::Make(colorsPM, 4));
 
     *bm->getAddr8(0, 0) = 0;