summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-05-07 13:44:17 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2021-05-07 18:32:04 +0200
commitbcd7a7244208a15e36a724270c72b496e77f84bf (patch)
treee20b9ed1e71c48386365d00e3aaaaf802c87d859 /android
parent60f7fe618a93818ffd08d2b950d4dfa2dde6a47b (diff)
tdf#142153 android: Delete unused textures immediately
Don't delay the call to 'glDeleteTextures' but always call it immediately via 'TextureReaper.get().reap()' in 'Subtile#cleanTexture'. Delaying it appears to sometimes cause it to be called "at the wrong time", resulting in black areas being shown instead of properly rendering/displaying the document content in the corresponding tile. This fixes the issue also mentioned in commit 1bc42472200c32c9a0a10dd1c3cd6c6a8a5d47d2 ("tdf#95517 android: Rework app/doc lifecycle handling"), which was present before, though: > (Well, sometimes there is an issue with > invalidation/repaint and single tiles remain black, > but that happened previously - when the whole doc > was loaded anew - just the same way). Change-Id: I5f18dbe3133d9d00a76b129fd119c2e80441e531 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115241 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/mozilla/gecko/gfx/SubTile.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java b/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
index 42750df62838..bdad37195d90 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/SubTile.java
@@ -86,26 +86,24 @@ public class SubTile extends Layer {
protected void finalize() throws Throwable {
try {
destroyImage();
- cleanTexture(false);
+ cleanTexture();
} finally {
super.finalize();
}
}
- private void cleanTexture(boolean immediately) {
+ private void cleanTexture() {
if (mTextureIDs != null) {
TextureReaper.get().add(mTextureIDs);
mTextureIDs = null;
- if (immediately) {
- TextureReaper.get().reap();
- }
+ TextureReaper.get().reap();
}
}
public void destroy() {
try {
destroyImage();
- cleanTexture(false);
+ cleanTexture();
} catch (Exception ex) {
Log.e(LOGTAG, "Error clearing buffers: ", ex);
}
@@ -140,7 +138,7 @@ public class SubTile extends Layer {
if (!textureSize.equals(mSize)) {
mSize = textureSize;
- cleanTexture(true);
+ cleanTexture();
}
}
@@ -253,4 +251,4 @@ public class SubTile extends Layer {
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}
}
-} \ No newline at end of file
+}