diff options
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
| -rw-r--r-- | libs/hwui/TextureCache.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 018ce3e77e8b..711277a56d8a 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -217,11 +217,15 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege texture->height = bitmap->height(); glBindTexture(GL_TEXTURE_2D, texture->id); - glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); + if (!regenerate) { + glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel()); + } switch (bitmap->getConfig()) { case SkBitmap::kA8_Config: - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + if (!regenerate) { + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + } uploadToTexture(resize, GL_ALPHA, bitmap->rowBytesAsPixels(), texture->height, GL_UNSIGNED_BYTE, bitmap->getPixels()); texture->blend = true; @@ -248,8 +252,10 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege break; } - texture->setFilter(GL_LINEAR, GL_LINEAR); - texture->setWrap(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE); + if (!regenerate) { + texture->setFilter(GL_NEAREST); + texture->setWrap(GL_CLAMP_TO_EDGE); + } } void TextureCache::uploadLoFiTexture(bool resize, SkBitmap* bitmap, |