summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-10-17 14:48:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-10-17 14:48:17 +0000
commitc7aa8fe62356fc09962941140c8bb7ed8bab2f8f (patch)
treee9f044e1c31ee95ef0d0919966f31ec3d8c1e7d5
parent69c8d39d1f9ebb55844ad7794d12fedf8b5be5bf (diff)
parent6de42dac4307a88fb99ced0a57293438600e3899 (diff)
downloadbase-l-preview.tar.gz
Merge "Removing some more FloatMath references"android-l-preview_r2l-preview
-rw-r--r--core/java/android/gesture/GestureStroke.java2
-rw-r--r--packages/WallpaperCropper/src/com/android/gallery3d/common/BitmapUtils.java7
2 files changed, 4 insertions, 5 deletions
diff --git a/core/java/android/gesture/GestureStroke.java b/core/java/android/gesture/GestureStroke.java
index bed904ef49d2..4a324f91fcb4 100644
--- a/core/java/android/gesture/GestureStroke.java
+++ b/core/java/android/gesture/GestureStroke.java
@@ -69,7 +69,7 @@ public class GestureStroke {
bx.bottom = p.y;
len = 0;
} else {
- len += Math.hypot(p.x - tmpPoints[(i - 1) * 2], p.y - tmpPoints[(i -1 ) * 2 + 1]);
+ len += Math.hypot(p.x - tmpPoints[(i - 1) * 2], p.y - tmpPoints[(i -1) * 2 + 1]);
bx.union(p.x, p.y);
}
index++;
diff --git a/packages/WallpaperCropper/src/com/android/gallery3d/common/BitmapUtils.java b/packages/WallpaperCropper/src/com/android/gallery3d/common/BitmapUtils.java
index a671ed2b9dfb..4e276db921c4 100644
--- a/packages/WallpaperCropper/src/com/android/gallery3d/common/BitmapUtils.java
+++ b/packages/WallpaperCropper/src/com/android/gallery3d/common/BitmapUtils.java
@@ -23,7 +23,6 @@ import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.os.Build;
-import android.util.FloatMath;
import android.util.Log;
import java.io.ByteArrayOutputStream;
@@ -72,7 +71,7 @@ public class BitmapUtils {
&& minSideLength == UNCONSTRAINED) return 1;
int lowerBound = (maxNumOfPixels == UNCONSTRAINED) ? 1 :
- (int) FloatMath.ceil(FloatMath.sqrt((float) (w * h) / maxNumOfPixels));
+ (int) Math.ceil(Math.sqrt((double) (w * h) / maxNumOfPixels));
if (minSideLength == UNCONSTRAINED) {
return lowerBound;
@@ -96,7 +95,7 @@ public class BitmapUtils {
// Find the min x that 1 / x >= scale
public static int computeSampleSizeLarger(float scale) {
- int initialSize = (int) FloatMath.floor(1f / scale);
+ int initialSize = (int) Math.floor(1 / scale);
if (initialSize <= 1) return 1;
return initialSize <= 8
@@ -107,7 +106,7 @@ public class BitmapUtils {
// Find the max x that 1 / x <= scale.
public static int computeSampleSize(float scale) {
Utils.assertTrue(scale > 0);
- int initialSize = Math.max(1, (int) FloatMath.ceil(1 / scale));
+ int initialSize = Math.max(1, (int) Math.ceil(1 / scale));
return initialSize <= 8
? Utils.nextPowerOf2(initialSize)
: (initialSize + 7) / 8 * 8;