summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-02-24 17:21:29 -0800
committer Romain Guy <romainguy@google.com> 2011-02-24 17:21:29 -0800
commitb37cbec6d06578a72bdd9c2caa3fd964ade71c53 (patch)
tree7b66637451a3b32894edf1882a953e45dcef573f /libs/hwui/TextureCache.cpp
parenta5364ee8942cd9f0546f80f6430812ca2ee59f30 (diff)
Correctly blend translucent GIF bitmaps.
Change-Id: Ifeb2c1d97a4c6dfeb1a7b5b26f1a3153e9f8da7f
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index e560b8f154f7..3752874053a6 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -209,13 +209,10 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege
// decoding happened
texture->blend = !bitmap->isOpaque();
break;
- case SkBitmap::kIndex8_Config:
- uploadLoFiTexture(resize, bitmap, texture->width, texture->height);
- texture->blend = false;
- break;
case SkBitmap::kARGB_4444_Config:
+ case SkBitmap::kIndex8_Config:
uploadLoFiTexture(resize, bitmap, texture->width, texture->height);
- texture->blend = true;
+ texture->blend = !bitmap->isOpaque();
break;
default:
LOGW("Unsupported bitmap config: %d", bitmap->getConfig());
@@ -235,6 +232,7 @@ void TextureCache::uploadLoFiTexture(bool resize, SkBitmap* bitmap,
rgbaBitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
rgbaBitmap.allocPixels();
rgbaBitmap.eraseColor(0);
+ rgbaBitmap.setIsOpaque(bitmap->isOpaque());
SkCanvas canvas(rgbaBitmap);
canvas.drawBitmap(*bitmap, 0.0f, 0.0f, NULL);