diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index 5394530c08828..320fc4d695de1 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -69,8 +69,11 @@ public class BitmapFactory { * the decoder will try to pick the best matching config based on the * system's screen depth, and characteristics of the original image such * as if it has per-pixel alpha (requiring a config that also does). + * + * The configuration is set to {@link android.graphics.Bitmap.Config#ARGB_8888} + * by default. */ - public Bitmap.Config inPreferredConfig; + public Bitmap.Config inPreferredConfig = Bitmap.Config.ARGB_8888; /** * If dither is true, the decoder will attempt to dither the decoded diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 612f04e5570ef..4977f46f73dda 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -133,7 +133,7 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege GL_RGB, GL_UNSIGNED_SHORT_5_6_5, bitmap->getPixels()); break; case SkBitmap::kARGB_8888_Config: - texture->blend = true; + texture->blend = !bitmap->isOpaque(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bitmap->rowBytesAsPixels(), texture->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap->getPixels()); break;