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

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Sun Jan 11 21:53:56 PST 2015


 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java            |    9 ++---
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java |   18 ++++------
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java    |    3 +
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java        |    1 
 4 files changed, 14 insertions(+), 17 deletions(-)

New commits:
commit c147457c6362540146e93ed5fb7f0162eeeb7c8d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon Jan 12 14:51:27 2015 +0900

    android: force screen to render - add access to LayerClient
    
    Change-Id: Ia65eebd153251985fe736e8f278d46b22a06ec83

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index a37caa7..4063a84 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -34,20 +34,19 @@ public class LOKitThread extends Thread implements TileProvider.TileInvalidation
             composedTileLayer.addTile(tile);
             mLayerClient.endDrawing(mViewportMetrics);
             if (forceRedraw) {
-                Log.i(LOGTAG, "Redrawing tile " + tileId);
-                mLayerClient.forceRedraw();
+                mLayerClient.forceRender();
             }
         }
     }
 
     private void tileRerender(ComposedTileLayer composedTileLayer, SubTile tile) {
-        if (composedTileLayer.isStillValid(tile.id)) {
+        if (composedTileLayer.isStillValid(tile.id) && !tile.markedForRemoval) {
+            Log.i(LOGTAG, "Redrawing tile " + tile.id);
             mLayerClient.beginDrawing();
             mTileProvider.rerenderTile(tile.getImage(), tile.id.x, tile.id.y, tile.id.size, tile.id.zoom);
             tile.invalidate();
-            Log.i(LOGTAG, "Redrawing tile " + tile.id);
-            mLayerClient.forceRedraw();
             mLayerClient.endDrawing(mViewportMetrics);
+            mLayerClient.forceRender();
         }
     }
 
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
index c1849d1..1bb15bc 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -397,6 +397,14 @@ public class GeckoLayerClient implements PanZoomTarget, LayerView.Listener {
         }
     }
 
+    public void forceRender() {
+        post(new Runnable() {
+            public void run() {
+                mView.requestRender();
+            }
+        });
+    }
+
     /** Implementation of PanZoomTarget */
     public boolean post(Runnable action) {
         return mView.post(action);
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java
index d359502..3d0ff1f 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/TileLayer.java
@@ -73,7 +73,6 @@ public abstract class TileLayer extends Layer {
      * Invalidates the entire buffer so that it will be uploaded again. Only valid inside a
      * transaction.
      */
-
     public void invalidate() {
         if (!inTransaction())
             throw new RuntimeException("invalidate() is only valid inside a transaction");
commit f7284c54ba258b95cc639e8d07efca1a06c0e0a5
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon Jan 12 14:49:39 2015 +0900

    android: remove checkerboard color property - fix set to white
    
    Change-Id: I7a11b0eea71e96f8bd2b307539f1964acb240216

diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
index 676e73c..c1849d1 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -96,7 +96,6 @@ public class GeckoLayerClient implements PanZoomTarget, LayerView.Listener {
         DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
         mViewportMetrics = new ImmutableViewportMetrics(displayMetrics);
         mZoomConstraints = new ZoomConstraints(false);
-        mCheckerboardColor = Color.WHITE;
 
         mPanZoomController = PanZoomController.Factory.create(this);
     }
@@ -247,15 +246,6 @@ public class GeckoLayerClient implements PanZoomTarget, LayerView.Listener {
         }
     }
 
-    int getCheckerboardColor() {
-        return mCheckerboardColor;
-    }
-
-    public void setCheckerboardColor(int newColor) {
-        mCheckerboardColor = newColor;
-        mView.requestRender();
-    }
-
     public void setZoomConstraints(ZoomConstraints constraints) {
         mZoomConstraints = constraints;
     }
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index 7b4ead3..6fe97b8 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -8,6 +8,7 @@ package org.mozilla.gecko.gfx;
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.graphics.Bitmap;
+import android.graphics.Color;
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.graphics.RectF;
@@ -571,7 +572,7 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
             GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
 
             /* Update background color. */
-            mBackgroundColor = mView.getLayerClient().getCheckerboardColor();
+            mBackgroundColor = Color.WHITE;
 
             /* Clear to the page background colour. The bits set here need to
              * match up with those used in gfx/layers/opengl/LayerManagerOGL.cpp.


More information about the Libreoffice-commits mailing list