summaryrefslogtreecommitdiffstats
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-27 18:57:51 -0700
committerRomain Guy <romainguy@google.com>2010-11-02 16:17:23 -0700
commit5b3b35296e8b2c8d3f07d32bb645d5414db41a1d (patch)
treebad2ebdbfeb8a3a0be1591d5a357a8280df7d1d2 /libs/hwui/TextureCache.cpp
parent2444ddb3d9b59ec45ba50858fcbff639e59b93b1 (diff)
downloadframeworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.zip
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.gz
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.bz2
Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index d860953..0c7948f 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -200,9 +200,13 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege
texture->blend = !bitmap->isOpaque();
break;
case SkBitmap::kIndex8_Config:
- uploadPalettedTexture(resize, bitmap, texture->width, texture->height);
+ uploadLoFiTexture(resize, bitmap, texture->width, texture->height);
texture->blend = false;
break;
+ case SkBitmap::kARGB_4444_Config:
+ uploadLoFiTexture(resize, bitmap, texture->width, texture->height);
+ texture->blend = true;
+ break;
default:
LOGW("Unsupported bitmap config: %d", bitmap->getConfig());
break;
@@ -215,7 +219,7 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
-void TextureCache::uploadPalettedTexture(bool resize, SkBitmap* bitmap,
+void TextureCache::uploadLoFiTexture(bool resize, SkBitmap* bitmap,
uint32_t width, uint32_t height) {
SkBitmap rgbaBitmap;
rgbaBitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);