summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author sergeyv <sergeyv@google.com> 2016-10-24 15:35:21 -0700
committer sergeyv <sergeyv@google.com> 2016-10-26 13:57:38 -0700
commit98fa4f9e7b33a3004ce9142c9acd4300391b9a0e (patch)
tree362ddb4cd164347c2008810d030c954d7dc2c778 /libs/hwui/TextureCache.cpp
parent817695589c80cfc0913d94e3dd52dac2782e8ed6 (diff)
Use Bitmap in Texture.upload
Test: refactoring cl. bug:32216791 Change-Id: Ib0b16c878d8371e0471e9a502f55626ec5999c60
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp12
1 files changed, 3 insertions, 9 deletions
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;
}