Fix regression to drawBitmapArray
253f2c213f6ecda63b6872aee77bd30d5ec07c82 accidentally
broke drawBitmapArray with hasAlpha=false. Revert the change
made as we have no need to support colorspaces in this
deprecated API
Change-Id: If858fad870faee33cc32e3361d0869351f6b0857
Fixes: 77310904
Test: sample app in bug
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index c9bfa13..7f90d8e 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -448,8 +448,9 @@
jboolean hasAlpha, jlong paintHandle) {
// Note: If hasAlpha is false, kRGB_565_SkColorType will be used, which will
// correct the alphaType to kOpaque_SkAlphaType.
- SkImageInfo info = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType,
- GraphicsJNI::defaultColorSpace());
+ SkImageInfo info = SkImageInfo::Make(width, height,
+ hasAlpha ? kN32_SkColorType : kRGB_565_SkColorType,
+ kPremul_SkAlphaType);
SkBitmap bitmap;
bitmap.setInfo(info);
sk_sp<Bitmap> androidBitmap = Bitmap::allocateHeapBitmap(&bitmap);