summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-12-11 14:27:39 -0800
committerJohn Reck <jreck@google.com>2014-12-11 14:27:39 -0800
commit9a7fe1a034bf0a9dea7c0676211bb780d3ab30be (patch)
tree65631f26270c93bb56c94c235ad0f18f30e39236
parentf8dc9d7b3d496593c6c6dddcd42cae13ac508876 (diff)
downloadframeworks_base-9a7fe1a034bf0a9dea7c0676211bb780d3ab30be.zip
frameworks_base-9a7fe1a034bf0a9dea7c0676211bb780d3ab30be.tar.gz
frameworks_base-9a7fe1a034bf0a9dea7c0676211bb780d3ab30be.tar.bz2
Force-flush state sync on texid change
Bug: 18718646 Caused because the Texture object thought the GLES texture was in a different state than it was as it persists across EGL/GL contexts. Fix this by force-flushing the default values when the texid has changed. Change-Id: I264bac9a2beb08df8e2ba8a85ad15f0dd1fce22a
-rw-r--r--libs/hwui/AssetAtlas.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/AssetAtlas.cpp b/libs/hwui/AssetAtlas.cpp
index c6de535..52ca92d 100644
--- a/libs/hwui/AssetAtlas.cpp
+++ b/libs/hwui/AssetAtlas.cpp
@@ -64,6 +64,12 @@ void AssetAtlas::terminate() {
void AssetAtlas::updateTextureId() {
mTexture->id = mImage ? mImage->getTexture() : 0;
+ if (mTexture->id) {
+ // Texture ID changed, force-set to defaults to sync the wrapper & GL
+ // state objects
+ mTexture->setWrap(GL_CLAMP_TO_EDGE, false, true);
+ mTexture->setFilter(GL_NEAREST, false, true);
+ }
for (size_t i = 0; i < mEntries.size(); i++) {
AssetAtlas::Entry* entry = mEntries.valueAt(i);
entry->texture->id = mTexture->id;