[Libreoffice-commits] core.git: android/Bootstrap android/source

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Thu Sep 24 13:54:15 PDT 2015


 android/Bootstrap/Makefile.shared                                        |    2 -
 android/Bootstrap/project.properties                                     |    2 -
 android/source/project.properties                                        |    2 -
 android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java |   11 ++++------
 android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java |    5 +---
 5 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 45c27ffcfd58aee86c92421af82525d873e54654
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Thu Sep 24 22:47:59 2015 +0200

    android.util.FloatMath is deprecated/was removed in ver 23
    
    replace with corresponding Math functions and bump android sdk target to
    23 to be able to use current appcompat-v7
    
    pre-JIT FloatMath was faster, but since then was wrapper to Math anyway
    http://developer.android.com/reference/android/util/FloatMath.html
    
    Change-Id: I19e316fb7d32e616162a70fca8c565fa320a8c1a

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index aaf50ce..a2aa45c 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -55,7 +55,7 @@ android_version_setup : $(BOOTSTRAPDIR)/no-resource-compress.xml
 prepare-appcompat:
 	mkdir $(APPCOMPATDIR) 2>/dev/null; true
 	cp -rf $(ANDROID_SDK_HOME)/extras/android/support/v7/appcompat/* $(APPCOMPATDIR)
-	$(ANDROID_SDK_HOME)/tools/android update lib-project --target android-21 --path $(APPCOMPATDIR)
+	$(ANDROID_SDK_HOME)/tools/android update lib-project --target android-23 --path $(APPCOMPATDIR)
 
 properties:
 	echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
diff --git a/android/Bootstrap/project.properties b/android/Bootstrap/project.properties
index ca81324..cb55769 100644
--- a/android/Bootstrap/project.properties
+++ b/android/Bootstrap/project.properties
@@ -9,4 +9,4 @@
 
 android.library=true
 # Project target.
-target=android-21
+target=android-23
diff --git a/android/source/project.properties b/android/source/project.properties
index 3580b11..62a52d4 100644
--- a/android/source/project.properties
+++ b/android/source/project.properties
@@ -8,7 +8,7 @@
 # project structure.
 
 # Project target.
-target=android-21
+target=android-23
 
 # Use the Bootstrap class
 android.library.reference.1=../Bootstrap
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java
index f860cd9..f2e164b 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/DisplayPortCalculator.java
@@ -7,7 +7,6 @@ package org.mozilla.gecko.gfx;
 
 import android.graphics.PointF;
 import android.graphics.RectF;
-import android.util.FloatMath;
 import android.util.Log;
 
 import org.json.JSONArray;
@@ -169,10 +168,10 @@ final class DisplayPortCalculator {
         float top = metrics.viewportRectTop - margins.top;
         float right = metrics.viewportRectRight + margins.right;
         float bottom = metrics.viewportRectBottom + margins.bottom;
-        left = Math.max(metrics.pageRectLeft, TILE_SIZE * FloatMath.floor(left / TILE_SIZE));
-        top = Math.max(metrics.pageRectTop, TILE_SIZE * FloatMath.floor(top / TILE_SIZE));
-        right = Math.min(metrics.pageRectRight, TILE_SIZE * FloatMath.ceil(right / TILE_SIZE));
-        bottom = Math.min(metrics.pageRectBottom, TILE_SIZE * FloatMath.ceil(bottom / TILE_SIZE));
+        left = (float) Math.max(metrics.pageRectLeft, TILE_SIZE * Math.floor(left / TILE_SIZE));
+        top = (float) Math.max(metrics.pageRectTop, TILE_SIZE * Math.floor(top / TILE_SIZE));
+        right = (float) Math.min(metrics.pageRectRight, TILE_SIZE * Math.ceil(right / TILE_SIZE));
+        bottom = (float) Math.min(metrics.pageRectBottom, TILE_SIZE * Math.ceil(bottom / TILE_SIZE));
         return new DisplayPortMetrics(left, top, right, bottom, zoom);
     }
 
@@ -722,7 +721,7 @@ final class DisplayPortCalculator {
         public boolean drawTimeUpdate(long millis, int pixels) {
             // calculate the number of frames it took to draw a viewport-sized area
             float normalizedTime = (float)mPixelArea * (float)millis / (float)pixels;
-            int normalizedFrames = (int)FloatMath.ceil(normalizedTime * 60f / 1000f);
+            int normalizedFrames = (int)Math.ceil(normalizedTime * 60f / 1000f);
             // broaden our range on how long it takes to draw if the draw falls outside
             // the range. this allows it to grow gradually. this heuristic may need to
             // be tweaked into more of a floating window average or something.
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
index 6765928..5a0f446 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
@@ -8,7 +8,6 @@ package org.mozilla.gecko.gfx;
 import android.graphics.PointF;
 import android.graphics.RectF;
 import android.os.Build;
-import android.util.FloatMath;
 import android.util.Log;
 import android.view.GestureDetector;
 import android.view.InputDevice;
@@ -428,7 +427,7 @@ public class JavaPanZoomController
     private float panDistance(MotionEvent move) {
         float dx = mX.panDistance(move.getX(0));
         float dy = mY.panDistance(move.getY(0));
-        return FloatMath.sqrt(dx * dx + dy * dy);
+        return (float) Math.sqrt(dx * dx + dy * dy);
     }
 
     private void track(float x, float y, long time) {
@@ -544,7 +543,7 @@ public class JavaPanZoomController
     private float getVelocity() {
         float xvel = mX.getRealVelocity();
         float yvel = mY.getRealVelocity();
-        return FloatMath.sqrt(xvel * xvel + yvel * yvel);
+        return (float) Math.sqrt(xvel * xvel + yvel * yvel);
     }
 
     public PointF getVelocityVector() {


More information about the Libreoffice-commits mailing list