[Libreoffice-commits] core.git: android/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Fri May 7 16:32:44 UTC 2021


 android/source/src/java/org/mozilla/gecko/gfx/SubTile.java |   14 +++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit bcd7a7244208a15e36a724270c72b496e77f84bf
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri May 7 13:44:17 2021 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri May 7 18:32:04 2021 +0200

    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 at posteo.de>

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
+}


More information about the Libreoffice-commits mailing list