summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2015-07-30 13:03:56 -0700
committerAdam Cohen <adamcohen@google.com>2015-07-30 13:04:54 -0700
commit0ff535eabbdf27ec5a790adbc64f27f8c63e7399 (patch)
tree704320ff7501361ba4566b860896de11ff0c793e /WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java
parent249a510ab318db461ce1ac86baca01021fe41a2c (diff)
downloadandroid_packages_apps_Trebuchet-0ff535eabbdf27ec5a790adbc64f27f8c63e7399.tar.gz
android_packages_apps_Trebuchet-0ff535eabbdf27ec5a790adbc64f27f8c63e7399.tar.bz2
android_packages_apps_Trebuchet-0ff535eabbdf27ec5a790adbc64f27f8c63e7399.zip
Remove references to FloatMath, deprecated in M
-> Allows us to build against M SDK issue 22822360 Change-Id: I1178eb6bafc348699c5be8c29858eb3dff093e11
Diffstat (limited to 'WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java')
-rw-r--r--WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java b/WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java
index a671ed2b9..38317eb41 100644
--- a/WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java
+++ b/WallpaperPicker/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((float) (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(1f / 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;