Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)
Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index cc09aae..9fb61e4 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -160,6 +160,16 @@
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);
}