From e651cc6239616a202f6e96ebc2ed93b4b8b3627c Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 14 May 2012 19:44:40 -0700 Subject: Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...) Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d --- libs/hwui/TextureCache.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/hwui/TextureCache.cpp') 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); } -- cgit v1.2.3-59-g8ed1b