diff options
| author | 2016-01-14 21:49:42 +0000 | |
|---|---|---|
| committer | 2016-01-14 21:49:42 +0000 | |
| commit | cbc5bd57f0f528743fce5ec02b0739dc6368311f (patch) | |
| tree | 45541b44b29965e05430cde89b2c5229eb7d7a14 /libs/hwui/TextDropShadowCache.cpp | |
| parent | f6762aca4a353a17cf79723f8a69b625b9e27237 (diff) | |
| parent | 38e0c32852e3b9d8ca4a9d3791577f52536419cb (diff) | |
Merge "Track texture memory globally"
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
| -rw-r--r-- | libs/hwui/TextDropShadowCache.cpp | 9 |
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); |