summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-06-23 11:03:19 +0200
committerJan Holesovsky <kendy@collabora.com>2014-06-30 14:48:02 +0200
commit18d2afbf9a544100c2decd99bee0eb5cf3e8f0e3 (patch)
treedefe65573f9b9ca71c8dd0a66c8a824c8e52da27 /android
parent7d8d1fe4aa887a134b10dff38299a1966b5b1c81 (diff)
LODroid2: GLES2 fixes, code cleanup
Change-Id: I368f8caaf0433387a330a63182aab292defef0ca
Diffstat (limited to 'android')
-rw-r--r--android/experimental/LOAndroid2/app/src/main/java/org/libreoffice/LOKitThread.java10
-rw-r--r--android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java2
-rw-r--r--android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/MultiTileLayer.java22
3 files changed, 15 insertions, 19 deletions
diff --git a/android/experimental/LOAndroid2/app/src/main/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid2/app/src/main/java/org/libreoffice/LOKitThread.java
index 08c49493cbd8..ea3472b8c52c 100644
--- a/android/experimental/LOAndroid2/app/src/main/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid2/app/src/main/java/org/libreoffice/LOKitThread.java
@@ -28,8 +28,8 @@ public class LOKitThread extends Thread {
private boolean draw() throws InterruptedException {
final LibreOfficeMainActivity application = LibreOfficeMainActivity.mAppContext;
- Bitmap bitmap = application.getLayerClient().getLayerController().getDrawable16("dummy_page");
- bitmap = convert(bitmap, Bitmap.Config.RGB_565);
+ Bitmap bitmap = application.getLayerClient().getLayerController().getDrawable("docu");
+ //bitmap = convert(bitmap, Bitmap.Config.ARGB_8888);
StringWriter stringWriter = new StringWriter();
@@ -41,11 +41,11 @@ public class LOKitThread extends Thread {
writer.name("y").value(0);
writer.name("width").value(bitmap.getWidth());
writer.name("height").value(bitmap.getHeight());
- writer.name("pageWidth").value(1000);
- writer.name("pageHeight").value(5000);
+ writer.name("pageWidth").value(bitmap.getWidth());
+ writer.name("pageHeight").value(bitmap.getHeight());
writer.name("offsetX").value(0);
writer.name("offsetY").value(0);
- writer.name("zoom").value(1.0);
+ writer.name("zoom").value(0.5);
} else {
writer.name("x").value(mViewportMetrics.getOrigin().x);
writer.name("y").value(mViewportMetrics.getOrigin().y);
diff --git a/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java b/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
index 97cbfb49acf8..fa1d5adb3c70 100644
--- a/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
+++ b/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
@@ -80,7 +80,7 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
public GeckoSoftwareLayerClient(Context context) {
super(context);
- mFormat = CairoImage.FORMAT_RGB16_565;
+ mFormat = CairoImage.FORMAT_ARGB32;
mCairoImage = new CairoImage() {
@Override
diff --git a/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/MultiTileLayer.java b/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/MultiTileLayer.java
index 3ade6c14d2d6..3514b4207461 100644
--- a/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/MultiTileLayer.java
+++ b/android/experimental/LOAndroid2/app/src/main/java/org/mozilla/gecko/gfx/MultiTileLayer.java
@@ -38,30 +38,26 @@
package org.mozilla.gecko.gfx;
-import org.mozilla.gecko.gfx.CairoImage;
-import org.mozilla.gecko.gfx.IntSize;
-import org.mozilla.gecko.gfx.SingleTileLayer;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
-import android.util.Log;
+
import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
import java.util.ArrayList;
/**
* Encapsulates the logic needed to draw a layer made of multiple tiles.
- *
+ * <p/>
* TODO: Support repeating.
*/
public class MultiTileLayer extends Layer {
private static final String LOGTAG = "GeckoMultiTileLayer";
private final CairoImage mImage;
+ private final ArrayList<SubTile> mTiles;
private IntSize mTileSize;
private IntSize mBufferSize;
- private final ArrayList<SubTile> mTiles;
public MultiTileLayer(CairoImage image, IntSize tileSize) {
super();
@@ -181,7 +177,7 @@ public class MultiTileLayer extends Layer {
if (!RectF.intersects(layerBounds, context.viewport)) {
if (firstDirtyTile == null)
firstDirtyTile = layer;
- dirtyTiles ++;
+ dirtyTiles++;
invalid = true;
} else {
// This tile intersects with the screen and is dirty,
@@ -207,7 +203,7 @@ public class MultiTileLayer extends Layer {
if (!screenUpdateDone && firstDirtyTile != null) {
firstDirtyTile.setSkipTextureUpdate(false);
firstDirtyTile.performUpdates(context);
- dirtyTiles --;
+ dirtyTiles--;
}
return (dirtyTiles == 0);
@@ -217,7 +213,7 @@ public class MultiTileLayer extends Layer {
IntSize size = getSize();
for (SubTile layer : mTiles) {
if (!inTransaction) {
- layer.beginTransaction(null);
+ layer.beginTransaction();
}
if (origin != null) {
@@ -246,11 +242,11 @@ public class MultiTileLayer extends Layer {
}
@Override
- public void beginTransaction(LayerView aView) {
- super.beginTransaction(aView);
+ public void beginTransaction() {
+ super.beginTransaction();
for (SubTile layer : mTiles) {
- layer.beginTransaction(aView);
+ layer.beginTransaction();
}
}