summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-01-09 17:31:23 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-12 11:06:42 +0100
commit156411e1aa39108bdf47e39dd531484a7e7db92c (patch)
tree625047e73acd419bc0fb865373502e8ca5697559 /android
parent616a0ac18f9d373dbdb9920a63d3ce6603eedd4e (diff)
android: Support force redraw in "tile request" event
Change-Id: I554200f67a529e2b2c352e956372811f35f8238c
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java4
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOEventFactory.java4
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java8
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java2
4 files changed, 12 insertions, 6 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
index cb71bb5084d5..77ad269179fa 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEvent.java
@@ -23,6 +23,7 @@ public class LOEvent implements Comparable<LOEvent> {
public String mFilename;
public TileIdentifier mTileId;
public ComposedTileLayer mComposedTileLayer;
+ public boolean mForceRedraw;
public LOEvent(int type) {
mType = type;
@@ -33,11 +34,12 @@ public class LOEvent implements Comparable<LOEvent> {
mTypeString = "Size Changed: " + widthPixels + " " + heightPixels;
}
- public LOEvent(int type, ComposedTileLayer composedTileLayer, TileIdentifier tileId) {
+ public LOEvent(int type, ComposedTileLayer composedTileLayer, TileIdentifier tileId, boolean forceRedraw) {
mType = type;
mTypeString = "Tile Request";
mComposedTileLayer = composedTileLayer;
mTileId = tileId;
+ mForceRedraw = forceRedraw;
}
public LOEvent(int type, String filename) {
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEventFactory.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEventFactory.java
index 62c5a36f2653..169c46e7241e 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEventFactory.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOEventFactory.java
@@ -29,8 +29,8 @@ public class LOEventFactory {
return new LOEvent(LOEvent.REDRAW);
}
- public static LOEvent tileRequest(ComposedTileLayer composedTileLayer, TileIdentifier tileRequest) {
- return new LOEvent(LOEvent.TILE_REQUEST, composedTileLayer, tileRequest);
+ public static LOEvent tileRequest(ComposedTileLayer composedTileLayer, TileIdentifier tileRequest, boolean forceRedraw) {
+ return new LOEvent(LOEvent.TILE_REQUEST, composedTileLayer, tileRequest, forceRedraw);
}
public static LOEvent thumbnail(ThumbnailCreator.ThumbnailCreationTask task) {
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 8fc75b2e394d..b30e4f5a845e 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -26,13 +26,17 @@ public class LOKitThread extends Thread {
TileProviderFactory.initialize();
}
- private void tileRequest(ComposedTileLayer composedTileLayer, TileIdentifier tileId) {
+ private void tileRequest(ComposedTileLayer composedTileLayer, TileIdentifier tileId, boolean forceRedraw) {
if (composedTileLayer.isStillValid(tileId)) {
mLayerClient.beginDrawing();
CairoImage image = mTileProvider.createTile(tileId.x, tileId.y, tileId.size, tileId.zoom);
SubTile tile = new SubTile(image, tileId);
composedTileLayer.addTile(tile);
mLayerClient.endDrawing(mViewportMetrics);
+ if (forceRedraw) {
+ Log.i(LOGTAG, "Redrawing tile " + tileId);
+ mLayerClient.forceRedraw();
+ }
}
}
@@ -123,7 +127,7 @@ public class LOKitThread extends Thread {
changePart(event.mPartIndex);
break;
case LOEvent.TILE_REQUEST:
- tileRequest(event.mComposedTileLayer, event.mTileId);
+ tileRequest(event.mComposedTileLayer, event.mTileId, event.mForceRedraw);
break;
case LOEvent.THUMBNAIL:
createThumbnail(event.mTask);
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 e6799b68919a..cfff2844f5fd 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
@@ -165,7 +165,7 @@ public abstract class ComposedTileLayer extends Layer {
}
}
if (!contains) {
- LOEvent event = LOEventFactory.tileRequest(this, new TileIdentifier((int) x, (int) y, zoom, tileSize));
+ LOEvent event = LOEventFactory.tileRequest(this, new TileIdentifier((int) x, (int) y, zoom, tileSize), false);
event.mPriority = getTilePriority();
LOKitShell.sendEvent(event);
}