summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-09-11 12:56:57 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-09-11 12:59:43 +0200
commit0968e47b7190832c6c06c0aa38f8da129660f854 (patch)
treed60b4f66b4de7e1fe23fcee8cca46172e36da6fc /android
parentaa4ac53ecdb5726a36ec642f860526f790586db9 (diff)
android: remove unneeded code paths
Change-Id: I5da4ca67caf2bc2e368c74cf719b080c63b6d47f
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java6
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java40
2 files changed, 15 insertions, 31 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index a831a559073a..b9dc0fb2e709 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -64,11 +64,7 @@ public class LOKitThread extends Thread {
mViewportMetrics.setPageSize(new FloatSize(pageWidth, pageHeight));
GeckoLayerClient layerClient = mApplication.getLayerClient();
- boolean shouldContinue = layerClient.beginDrawing(mViewportMetrics);
-
- if (!shouldContinue) {
- return false;
- }
+ layerClient.beginDrawing(mViewportMetrics);
ViewportMetrics metrics = mApplication.getLayerController().getViewportMetrics();
RectF viewport = normlizeRect(metrics);
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 bfac3a9d14be..cf13afb9eb59 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
@@ -81,18 +81,12 @@ public class GeckoLayerClient {
mScreenSize = new IntSize(0, 0);
}
- protected boolean setupLayer() {
- Log.i(LOGTAG, "Creating MultiTileLayer");
+ protected void setupLayer() {
if (mTileLayer == null) {
+ Log.i(LOGTAG, "Creating MultiTileLayer");
mTileLayer = new MultiTileLayer(TILE_SIZE);
mLayerController.setRoot(mTileLayer);
}
-
- // Force a resize event to be sent because the results of this
- // are different depending on what tile system we're using
- //sendResizeEventIfNecessary(true);
-
- return false;
}
protected void updateLayerAfterDraw() {
@@ -119,15 +113,10 @@ public class GeckoLayerClient {
sendResizeEventIfNecessary(false);
}
- public boolean beginDrawing(ViewportMetrics viewportMetrics) {
- if (setupLayer()) {
- Log.e(LOGTAG, "### Cancelling due to layer setup");
- return false;
- }
+ public void beginDrawing(ViewportMetrics viewportMetrics) {
+ setupLayer();
mNewGeckoViewport = viewportMetrics;
mTileLayer.beginTransaction();
-
- return true;
}
public void endDrawing() {
@@ -213,19 +202,11 @@ public class GeckoLayerClient {
long timeDelta = System.currentTimeMillis() - mLastViewportChangeTime;
if (timeDelta < MIN_VIEWPORT_CHANGE_DELAY) {
- mLayerController.getView().postDelayed(
- new Runnable() {
- public void run() {
- mPendingViewportAdjust = false;
- adjustViewport();
- }
- }, MIN_VIEWPORT_CHANGE_DELAY - timeDelta
- );
+ mLayerController.getView().postDelayed(new AdjustRunnable(), MIN_VIEWPORT_CHANGE_DELAY - timeDelta);
mPendingViewportAdjust = true;
- return;
+ } else {
+ adjustViewport();
}
-
- adjustViewport();
}
public void viewportSizeChanged() {
@@ -273,4 +254,11 @@ public class GeckoLayerClient {
}
return null;
}
+
+ private class AdjustRunnable implements Runnable {
+ public void run() {
+ mPendingViewportAdjust = false;
+ adjustViewport();
+ }
+ }
} \ No newline at end of file