summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2012-05-14 19:44:40 -0700
committer Romain Guy <romainguy@google.com> 2012-05-14 19:44:40 -0700
commite651cc6239616a202f6e96ebc2ed93b4b8b3627c (patch)
tree7aa90f8cccc91555bd652d0a88a898a026cdc333 /libs/hwui/TextureCache.cpp
parent99a6ddd4cd8762654a575eb4ac3d0e5431d919b8 (diff)
Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)
Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index cc09aaec32d4..9fb61e486266 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -160,6 +160,16 @@ Texture* TextureCache::get(SkBitmap* bitmap) {
return texture;
}
+Texture* TextureCache::getTransient(SkBitmap* bitmap) {
+ Texture* texture = new Texture;
+ texture->bitmapSize = bitmap->rowBytes() * bitmap->height();
+ texture->cleanup = true;
+
+ generateTexture(bitmap, texture, false);
+
+ return texture;
+}
+
void TextureCache::remove(SkBitmap* bitmap) {
mCache.remove(bitmap);
}