summaryrefslogtreecommitdiff
path: root/libs/hwui/TextDropShadowCache.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2015-11-10 12:19:17 -0800
committer John Reck <jreck@google.com> 2016-01-14 13:42:12 -0800
commit38e0c32852e3b9d8ca4a9d3791577f52536419cb (patch)
tree72286f7531e094182b2bfe959015d7ed7f9c6abc /libs/hwui/TextDropShadowCache.cpp
parenta5abf801044c5e53349c2e67428fe011a2f6985f (diff)
Track texture memory globally
Also mostly consolidates texture creation Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
-rw-r--r--libs/hwui/TextDropShadowCache.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 51f16523966b..f1e28b7dfa40 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -187,13 +187,10 @@ ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const char* glyphs
texture = new ShadowTexture(caches);
texture->left = shadow.penX;
texture->top = shadow.penY;
- texture->width = shadow.width;
- texture->height = shadow.height;
texture->generation = 0;
texture->blend = true;
const uint32_t size = shadow.width * shadow.height;
- texture->bitmapSize = size;
// Don't even try to cache a bitmap that's bigger than the cache
if (size < mMaxSize) {
@@ -202,15 +199,11 @@ ShadowTexture* TextDropShadowCache::get(const SkPaint* paint, const char* glyphs
}
}
- glGenTextures(1, &texture->id);
-
- caches.textureState().bindTexture(texture->id);
// Textures are Alpha8
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, texture->width, texture->height, 0,
+ texture->upload(GL_ALPHA, shadow.width, shadow.height,
GL_ALPHA, GL_UNSIGNED_BYTE, shadow.image);
-
texture->setFilter(GL_LINEAR);
texture->setWrap(GL_CLAMP_TO_EDGE);