summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-07-07 17:16:09 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-07-10 11:17:53 +0200
commite7b401d9fb86da9b6d18709a21886cb91e7a0ce5 (patch)
tree24e6130b0cecf3d244499865b90bd2001d258e49 /android
parent7b55df0b2c04f1a58922585415bc2e32c5d68e08 (diff)
LOAndorid3: Clean unused code, add getTiles() to MultiTileLayer
Change-Id: I1a539d10de2ad8bf7410a59adafcb18cc2639068
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FlexibleGLSurfaceView.java24
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java10
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java26
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java15
-rw-r--r--android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java10
5 files changed, 19 insertions, 66 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FlexibleGLSurfaceView.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FlexibleGLSurfaceView.java
index dc20077b0457..0f47524704e3 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FlexibleGLSurfaceView.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/FlexibleGLSurfaceView.java
@@ -46,8 +46,6 @@ import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
-import org.libreoffice.LibreOfficeMainActivity;
-
public class FlexibleGLSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
private static final String LOGTAG = "GeckoFlexibleGLSurfaceView";
@@ -151,8 +149,7 @@ public class FlexibleGLSurfaceView extends SurfaceView implements SurfaceHolder.
return mController;
}
- public synchronized void surfaceChanged(SurfaceHolder holder, int format, int width,
- int height) {
+ public synchronized void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
mController.sizeChanged(width, height);
if (mGLThread != null) {
mGLThread.surfaceChanged(width, height);
@@ -181,25 +178,6 @@ public class FlexibleGLSurfaceView extends SurfaceView implements SurfaceHolder.
}
}
- // Called from the compositor thread
- public static GLController registerCxxCompositor() {
- try {
- Log.e(LOGTAG, "### registerCxxCompositor point A");
- System.out.println("register layer comp");
- Log.e(LOGTAG, "### registerCxxCompositor point B");
- FlexibleGLSurfaceView flexView = (FlexibleGLSurfaceView) /*GeckoApp*/LibreOfficeMainActivity.mAppContext.getLayerController().getView();
- Log.e(LOGTAG, "### registerCxxCompositor point C: " + flexView);
- try {
- flexView.destroyGLThread().join();
- } catch (InterruptedException e) {}
- Log.e(LOGTAG, "### registerCxxCompositor point D: " + flexView.getGLController());
- return flexView.getGLController();
- } catch (Exception e) {
- Log.e(LOGTAG, "### Exception! " + e);
- return null;
- }
- }
-
public interface Listener {
void renderRequested();
void compositionPauseRequested();
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 d7fe6b3db5a9..5fd130f11d78 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
@@ -39,16 +39,12 @@
package org.mozilla.gecko.gfx;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.Rect;
-import android.graphics.RectF;
import android.os.SystemClock;
import android.util.DisplayMetrics;
import android.util.Log;
-import org.json.JSONException;
import org.json.JSONObject;
import org.libreoffice.LOEvent;
import org.libreoffice.LOKitShell;
@@ -56,7 +52,6 @@ import org.libreoffice.LibreOfficeMainActivity;
import org.mozilla.gecko.GeckoEventListener;
import org.mozilla.gecko.util.FloatUtils;
-import java.util.regex.Matcher;
import java.util.regex.Pattern;
public abstract class GeckoLayerClient implements GeckoEventListener {
@@ -72,7 +67,6 @@ public abstract class GeckoLayerClient implements GeckoEventListener {
private long mLastViewportChangeTime;
private boolean mPendingViewportAdjust;
private boolean mViewportSizeChanged;
-
// mUpdateViewportOnEndDraw is used to indicate that we received a
// viewport update notification while drawing. therefore, when the
// draw finishes, we need to update the entire viewport rather than
@@ -81,8 +75,6 @@ public abstract class GeckoLayerClient implements GeckoEventListener {
private boolean mUpdateViewportOnEndDraw;
private String mLastCheckerboardColor;
- protected LayerController mLayerController;
-
public GeckoLayerClient(Context context) {
mScreenSize = new IntSize(0, 0);
}
@@ -110,7 +102,7 @@ public abstract class GeckoLayerClient implements GeckoEventListener {
}
public boolean beginDrawing(ViewportMetrics viewportMetrics) {
- if (setupLayer()) {
+ if (setupLayer()) {
Log.e(LOGTAG, "### Cancelling due to layer setup");
return false;
}
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
index e09e72788125..66adaf2922cc 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
@@ -38,24 +38,11 @@
package org.mozilla.gecko.gfx;
-import org.libreoffice.LOKitShell;
-import org.mozilla.gecko.gfx.CairoImage;
-import org.mozilla.gecko.gfx.IntSize;
-import org.mozilla.gecko.gfx.GeckoLayerClient;
-import org.mozilla.gecko.gfx.LayerController;
-import org.mozilla.gecko.gfx.LayerRenderer;
-import org.mozilla.gecko.gfx.MultiTileLayer;
-import org.mozilla.gecko.gfx.PointUtils;
-import org.mozilla.gecko.gfx.WidgetTileLayer;
-//import org.mozilla.gecko.GeckoAppShell;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.graphics.RectF;
import android.util.Log;
-import java.nio.ByteBuffer;
+
+import java.util.List;
+
/**
* Transfers a software-rendered Gecko to an ImageLayer so that it can be rendered by our
@@ -128,5 +115,12 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
((MultiTileLayer)mTileLayer).addTile(tile);
}
}
+
+ public List<SubTile> getTiles() {
+ if (mTileLayer instanceof MultiTileLayer) {
+ return ((MultiTileLayer)mTileLayer).getTiles();
+ }
+ return null;
+ }
}
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
index e237052976c7..0ddd7aa2916e 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
@@ -276,15 +276,6 @@ public class LayerController {
return BitmapFactory.decodeResource(mContext.getResources(), resourceID, options);
}
- public Bitmap getDrawable16(String name) {
- Resources resources = mContext.getResources();
- int resourceID = resources.getIdentifier(name, "drawable", mContext.getPackageName());
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inScaled = false;
- options.inPreferredConfig = Bitmap.Config.RGB_565;
- return BitmapFactory.decodeResource(mContext.getResources(), resourceID, options);
- }
-
/**
* Scrolls the viewport by the given offset. You must hold the monitor while calling this.
*/
@@ -293,9 +284,7 @@ public class LayerController {
origin.offset(point.x, point.y);
mViewportMetrics.setOrigin(origin);
Log.d(LOGTAG, "scrollBy: " + mViewportMetrics);
-
notifyLayerClientOfGeometryChange();
- //GeckoApp.mAppContext.repositionPluginViews(false);
mView.requestRender();
}
@@ -310,7 +299,6 @@ public class LayerController {
// We assume the zoom level will only be modified by the
// PanZoomController, so no need to notify it of this change.
notifyLayerClientOfGeometryChange();
- //GeckoApp.mAppContext.repositionPluginViews(false);
mView.requestRender();
}
@@ -327,8 +315,9 @@ public class LayerController {
* the geometry changed.
*/
public void notifyLayerClientOfGeometryChange() {
- if (mLayerClient != null)
+ if (mLayerClient != null) {
mLayerClient.geometryChanged();
+ }
}
/**
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java
index 65f4e79e5490..e13bda872213 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/MultiTileLayer.java
@@ -38,18 +38,14 @@
package org.mozilla.gecko.gfx;
-import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.util.Log;
-import org.libreoffice.LOKitShell;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.List;
/**
* Encapsulates the logic needed to draw a layer made of multiple tiles.
@@ -242,5 +238,9 @@ public class MultiTileLayer extends Layer {
public void addTile(SubTile tile) {
mTiles.add(tile);
}
+
+ public List<SubTile> getTiles() {
+ return mTiles;
+ }
}