summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-06-30 15:51:03 -0700
committer Romain Guy <romainguy@google.com> 2010-06-30 15:51:03 -0700
commit364703c6fa4aa1a7d2ef5b0c048ea2a0d57a4c40 (patch)
treebb39ba42acd1d5e16c3120a89b1de216d65c0950 /libs/hwui/TextureCache.cpp
parent68e9a49aeb0b07d0d99c0a05771348bcd460a703 (diff)
Fix the build.
Change-Id: I08bd6daf25351daca3ae552e1cfcfce85eefa73b
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index b4a57eef2caf..fd12a3c19db0 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -40,7 +40,8 @@ void TextureCache::operator()(SkBitmap* key, Texture* value) {
Texture* TextureCache::get(SkBitmap* bitmap) {
Texture* texture = mCache.get(bitmap);
if (!texture) {
- texture = generateTexture(bitmap);
+ texture = new Texture;
+ generateTexture(bitmap, texture);
mCache.put(bitmap, texture);
}
return texture;
@@ -54,9 +55,7 @@ void TextureCache::clear() {
mCache.clear();
}
-Texture* TextureCache::generateTexture(SkBitmap* bitmap) {
- Texture* texture = new Texture;
-
+void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture) {
texture->width = bitmap->width();
texture->height = bitmap->height();
@@ -77,6 +76,8 @@ Texture* TextureCache::generateTexture(SkBitmap* bitmap) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->width, texture->height,
0, GL_RGBA, GL_UNSIGNED_BYTE, bitmap->getPixels());
break;
+ default:
+ break;
}
return texture;