[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Fri Jan 9 03:25:31 PST 2015
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java | 24 ++--------
1 file changed, 6 insertions(+), 18 deletions(-)
New commits:
commit bfcb1375956877ebd669edf409b71c2a11cc64ce
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Fri Jan 9 20:24:38 2015 +0900
android: reuse rerenderTile in createTile
Change-Id: Ibafdcf5dd54804b4c50dd51d9a5a89dc7088052d
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index d8e11bc..fe389ef 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -189,25 +189,8 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
@Override
public CairoImage createTile(float x, float y, IntSize tileSize, float zoom) {
ByteBuffer buffer = ByteBuffer.allocateDirect(tileSize.width * tileSize.height * 4);
-
- if (mDocument != null) {
- float twipX = pixelToTwip(x, mDPI) / zoom;
- float twipY = pixelToTwip(y, mDPI) / zoom;
- float twipWidth = mTileWidth / zoom;
- float twipHeight = mTileHeight / zoom;
- long start = System.currentTimeMillis() - objectCreationTime;
-
- //Log.i(LOGTAG, "paintTile >> @" + start + " (" + tileSize.width + " " + tileSize.height + " " + (int) twipX + " " + (int) twipY + " " + (int) twipWidth + " " + (int) twipHeight + ")");
- mDocument.paintTile(buffer, tileSize.width, tileSize.height, (int) twipX, (int) twipY, (int) twipWidth, (int) twipHeight);
-
- long stop = System.currentTimeMillis() - objectCreationTime;
- //Log.i(LOGTAG, "paintTile << @" + stop + " elapsed: " + (stop - start));
- } else {
- Log.e(LOGTAG, "Document is null!!");
- }
-
CairoImage image = new BufferedCairoImage(buffer, tileSize.width, tileSize.height, CairoImage.FORMAT_ARGB32);
-
+ rerenderTile(image, x, y, tileSize, zoom);
return image;
}
@@ -218,8 +201,13 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback
float twipY = pixelToTwip(y, mDPI) / zoom;
float twipWidth = mTileWidth / zoom;
float twipHeight = mTileHeight / zoom;
+ long start = System.currentTimeMillis() - objectCreationTime;
+ //Log.i(LOGTAG, "paintTile >> @" + start + " (" + tileSize.width + " " + tileSize.height + " " + (int) twipX + " " + (int) twipY + " " + (int) twipWidth + " " + (int) twipHeight + ")");
mDocument.paintTile(image.getBuffer(), tileSize.width, tileSize.height, (int) twipX, (int) twipY, (int) twipWidth, (int) twipHeight);
+
+ long stop = System.currentTimeMillis() - objectCreationTime;
+ //Log.i(LOGTAG, "paintTile << @" + stop + " elapsed: " + (stop - start));
} else {
if (mDocument == null) {
Log.e(LOGTAG, "Document is null!!");
More information about the Libreoffice-commits
mailing list