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.vajng...@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!!");
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits