Loading core/jni/android/graphics/BitmapFactory.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -327,7 +327,18 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, const float sx = scaledWidth / float(decoded->width()); const float sy = scaledHeight / float(decoded->height()); bitmap->setConfig(decoded->getConfig(), scaledWidth, scaledHeight); SkBitmap::Config config = decoded->config(); switch (config) { case SkBitmap::kNo_Config: case SkBitmap::kIndex8_Config: case SkBitmap::kRLE_Index8_Config: config = SkBitmap::kARGB_8888_Config; break; default: break; } bitmap->setConfig(config, scaledWidth, scaledHeight); bitmap->setIsOpaque(decoded->isOpaque()); bitmap->allocPixels(&javaAllocator, NULL); bitmap->eraseColor(0); Loading Loading
core/jni/android/graphics/BitmapFactory.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -327,7 +327,18 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding, const float sx = scaledWidth / float(decoded->width()); const float sy = scaledHeight / float(decoded->height()); bitmap->setConfig(decoded->getConfig(), scaledWidth, scaledHeight); SkBitmap::Config config = decoded->config(); switch (config) { case SkBitmap::kNo_Config: case SkBitmap::kIndex8_Config: case SkBitmap::kRLE_Index8_Config: config = SkBitmap::kARGB_8888_Config; break; default: break; } bitmap->setConfig(config, scaledWidth, scaledHeight); bitmap->setIsOpaque(decoded->isOpaque()); bitmap->allocPixels(&javaAllocator, NULL); bitmap->eraseColor(0); Loading