diff --git a/mobile/android/base/gfx/DisplayPortCalculator.java b/mobile/android/base/gfx/DisplayPortCalculator.java index a46ed5cf37da..3f56c2a3666f 100644 --- a/mobile/android/base/gfx/DisplayPortCalculator.java +++ b/mobile/android/base/gfx/DisplayPortCalculator.java @@ -13,7 +13,6 @@ import org.json.JSONArray; import android.graphics.PointF; import android.graphics.RectF; -import android.util.FloatMath; import android.util.Log; import java.util.HashMap; @@ -184,10 +183,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); } @@ -747,7 +746,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 * millis / 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/mobile/android/base/gfx/IntSize.java b/mobile/android/base/gfx/IntSize.java index b758d732c2ed..0e847158d70b 100644 --- a/mobile/android/base/gfx/IntSize.java +++ b/mobile/android/base/gfx/IntSize.java @@ -8,8 +8,6 @@ package org.mozilla.gecko.gfx; import org.json.JSONException; import org.json.JSONObject; -import android.util.FloatMath; - public class IntSize { public final int width, height; @@ -75,7 +73,7 @@ public class IntSize { } public static int largestPowerOfTwoLessThan(float value) { - int val = (int)FloatMath.floor(value); + int val = (int) Math.floor(value); if (val <= 0) { throw new IllegalArgumentException("Error: value must be > 0"); } diff --git a/mobile/android/base/gfx/JavaPanZoomController.java b/mobile/android/base/gfx/JavaPanZoomController.java index d27eef807231..42b7c65ffed6 100644 --- a/mobile/android/base/gfx/JavaPanZoomController.java +++ b/mobile/android/base/gfx/JavaPanZoomController.java @@ -21,7 +21,6 @@ import org.mozilla.gecko.util.ThreadUtils; import android.graphics.PointF; import android.graphics.RectF; -import android.util.FloatMath; import android.util.Log; import android.view.GestureDetector; import android.view.InputDevice; @@ -668,7 +667,7 @@ 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) { @@ -801,7 +800,7 @@ 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); } @Override diff --git a/mobile/android/tests/browser/robocop/MotionEventHelper.java b/mobile/android/tests/browser/robocop/MotionEventHelper.java index 0f1402acf14c..ce1c5d1ed795 100644 --- a/mobile/android/tests/browser/robocop/MotionEventHelper.java +++ b/mobile/android/tests/browser/robocop/MotionEventHelper.java @@ -9,7 +9,6 @@ import org.mozilla.gecko.gfx.LayerView; import android.app.Instrumentation; import android.os.SystemClock; -import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; @@ -133,7 +132,7 @@ class MotionEventHelper { // will trigger the fling. final float dx = (endX - startX) / 2; final float dy = (endY - startY) / 2; - float distance = FloatMath.sqrt((dx * dx) + (dy * dy)); + float distance = (float) Math.sqrt((dx * dx) + (dy * dy)); final long time = (long)(distance / velocity); if (time <= 0) { throw new IllegalArgumentException( "Fling parameters require too small a time period" );