From 98fa4f9e7b33a3004ce9142c9acd4300391b9a0e Mon Sep 17 00:00:00 2001 From: sergeyv Date: Mon, 24 Oct 2016 15:35:21 -0700 Subject: Use Bitmap in Texture.upload Test: refactoring cl. bug:32216791 Change-Id: Ib0b16c878d8371e0471e9a502f55626ec5999c60 --- libs/hwui/TextureCache.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libs/hwui/TextureCache.cpp') diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 08641b7234dd..14ffc85a4f68 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -127,9 +127,7 @@ Texture* TextureCache::getCachedTexture(Bitmap* bitmap) { texture = new Texture(Caches::getInstance()); texture->bitmapSize = size; texture->generation = bitmap->getGenerationID(); - SkBitmap skBitmap; - bitmap->getSkBitmap(&skBitmap); - texture->upload(skBitmap); + texture->upload(*bitmap); mSize += size; TEXTURE_LOGD("TextureCache::get: create texture(%p): name, size, mSize = %d, %d, %d", @@ -142,9 +140,7 @@ Texture* TextureCache::getCachedTexture(Bitmap* bitmap) { } else if (!texture->isInUse && bitmap->getGenerationID() != texture->generation) { // Texture was in the cache but is dirty, re-upload // TODO: Re-adjust the cache size if the bitmap's dimensions have changed - SkBitmap skBitmap; - bitmap->getSkBitmap(&skBitmap); - texture->upload(skBitmap); + texture->upload(*bitmap); texture->generation = bitmap->getGenerationID(); } @@ -174,9 +170,7 @@ Texture* TextureCache::get(Bitmap* bitmap) { const uint32_t size = bitmap->rowBytes() * bitmap->height(); texture = new Texture(Caches::getInstance()); texture->bitmapSize = size; - SkBitmap skBitmap; - bitmap->getSkBitmap(&skBitmap); - texture->upload(skBitmap); + texture->upload(*bitmap); texture->generation = bitmap->getGenerationID(); texture->cleanup = true; } -- cgit v1.2.3-59-g8ed1b