summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-02-24 17:45:21 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-24 17:45:21 -0800
commit7f4a537af5ec1c935b9d139b722da05e9fe8130f (patch)
treefac8a0550aea4d9343cb6af7061f9d3d25b8e3a8
parentf36ec34f40b0dc8ff37eaa97d5c5f70fc95b4779 (diff)
parentb37cbec6d06578a72bdd9c2caa3fd964ade71c53 (diff)
downloadframeworks_base-7f4a537af5ec1c935b9d139b722da05e9fe8130f.zip
frameworks_base-7f4a537af5ec1c935b9d139b722da05e9fe8130f.tar.gz
frameworks_base-7f4a537af5ec1c935b9d139b722da05e9fe8130f.tar.bz2
Merge "Correctly blend translucent GIF bitmaps."
-rw-r--r--libs/hwui/OpenGLRenderer.cpp5
-rw-r--r--libs/hwui/TextDropShadowCache.h1
-rw-r--r--libs/hwui/TextureCache.cpp8
3 files changed, 6 insertions, 8 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index a0aea00..cc88236 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1982,9 +1982,8 @@ void OpenGLRenderer::getAlphaAndMode(SkPaint* paint, int* alpha, SkXfermode::Mod
}
SkXfermode::Mode OpenGLRenderer::getXfermode(SkXfermode* mode) {
- /* In the future we should look at unifying the Porter-Duff modes and
- * SkXferModes so that we can use SkXfermode::IsMode(xfer, &mode).
- */
+ // In the future we should look at unifying the Porter-Duff modes and
+ // SkXferModes so that we can use SkXfermode::IsMode(xfer, &mode).
if (mode == NULL) {
return SkXfermode::kSrcOver_Mode;
}
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index ffccfa2..1e065d1 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -58,6 +58,7 @@ struct ShadowText {
SkTypeface* typeface;
String8 str;
+ // TODO: Should take into account fake bold and text skew
bool operator<(const ShadowText& rhs) const {
LTE_INT(len) {
LTE_INT(radius) {
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index e560b8f..3752874 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);