[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 2 commits - android/experimental

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Jan 20 17:50:26 PST 2015


 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java             |    2 ++
 android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java          |    6 ++++++
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java |    4 ++++
 3 files changed, 12 insertions(+)

New commits:
commit 1f3d8930ecdb7bbc6d8f9e4d70a4edb151dfbc1e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Jan 21 10:22:44 2015 +0900

    android: construct a "css" rect of the tile in TileIdentifier
    
    Change-Id: I98417dbb6b607b127540292fcae6a8efce4a7da4

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java
index 7c51b52..40ec60c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/TileIdentifier.java
@@ -21,6 +21,12 @@ public class TileIdentifier {
         return new RectF(x, y, x + size.width, y + size.height);
     }
 
+    public RectF getCSSRect() {
+        float cssX = x * zoom;
+        float cssY = y * zoom;
+        return new RectF(cssX, cssY, cssX + (size.width * zoom), cssY + (size.height * zoom));
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
commit 6fffceeda3ddd3a10b46cc0f65e2172c7824c64e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Wed Jan 21 10:19:11 2015 +0900

    android: cleanup new tileid's if they gone out of viewport scope
    
    It can happen that the viewport moves so fast that the tileid is
    not valid anymore before it could even be rendered to.
    
    Change-Id: I5ff7d3de6b289ca48ea8a8974705d8306e1be86b

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 3b7f657..9954ea8 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -37,6 +37,8 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation
             if (forceRedraw) {
                 mLayerClient.forceRender();
             }
+        } else {
+            composedTileLayer.cleanupInvalidTile(tileId);
         }
     }
 
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
index e169056..7989ffe 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -240,4 +240,8 @@ public abstract class ComposedTileLayer extends Layer implements ComponentCallba
             //clearAndReset();
         }
     }
+
+    public void cleanupInvalidTile(TileIdentifier tileId) {
+        newTileIds.remove(tileId);
+    }
 }
\ No newline at end of file


More information about the Libreoffice-commits mailing list