summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/photoeditor
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-02-11 07:19:47 +0800
committerChih-Chung Chang <chihchung@google.com>2012-02-11 07:20:05 +0800
commite1e40b31bfce1885fb96edd1f92016cd73077d36 (patch)
tree5df2e2c294f0f7c65ea75452d44d564780bf38e9 /src/com/android/gallery3d/photoeditor
parentfeef78c1ecf63c88e052698040e809f25ffef0c4 (diff)
downloadandroid_packages_apps_Snap-e1e40b31bfce1885fb96edd1f92016cd73077d36.tar.gz
android_packages_apps_Snap-e1e40b31bfce1885fb96edd1f92016cd73077d36.tar.bz2
android_packages_apps_Snap-e1e40b31bfce1885fb96edd1f92016cd73077d36.zip
Use FloatMath instead of Math.
Change-Id: I26eb6a554f72c13ba2801ce35ef0cf2a1466a97b
Diffstat (limited to 'src/com/android/gallery3d/photoeditor')
-rw-r--r--src/com/android/gallery3d/photoeditor/RendererUtils.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/photoeditor/RendererUtils.java b/src/com/android/gallery3d/photoeditor/RendererUtils.java
index b92907df0..3edcff5f5 100644
--- a/src/com/android/gallery3d/photoeditor/RendererUtils.java
+++ b/src/com/android/gallery3d/photoeditor/RendererUtils.java
@@ -19,6 +19,7 @@ package com.android.gallery3d.photoeditor;
import android.graphics.Bitmap;
import android.opengl.GLES20;
import android.opengl.GLUtils;
+import android.util.FloatMath;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -153,8 +154,8 @@ public class RendererUtils {
public static void setRenderToRotate(RenderContext context, int srcWidth, int srcHeight,
int dstWidth, int dstHeight, float degrees) {
float radian = -degrees * DEGREE_TO_RADIAN;
- float cosTheta = (float) Math.cos(radian);
- float sinTheta = (float) Math.sin(radian);
+ float cosTheta = FloatMath.cos(radian);
+ float sinTheta = FloatMath.sin(radian);
float cosWidth = cosTheta * srcWidth;
float sinWidth = sinTheta * srcWidth;
float cosHeight = cosTheta * srcHeight;
@@ -205,8 +206,8 @@ public class RendererUtils {
System.arraycopy(base, 0, vertices, 0, vertices.length);
if (horizontalDegrees % 180f != 0) {
float radian = (horizontalDegrees - horizontalRounds * 180) * DEGREE_TO_RADIAN;
- float cosTheta = (float) Math.cos(radian);
- float sinTheta = (float) Math.sin(radian);
+ float cosTheta = FloatMath.cos(radian);
+ float sinTheta = FloatMath.sin(radian);
float scale = length / (length + sinTheta * base[0]);
vertices[0] = cosTheta * base[0] * scale;
@@ -223,8 +224,8 @@ public class RendererUtils {
if (verticalDegrees % 180f != 0) {
float radian = (verticalDegrees - verticalRounds * 180) * DEGREE_TO_RADIAN;
- float cosTheta = (float) Math.cos(radian);
- float sinTheta = (float) Math.sin(radian);
+ float cosTheta = FloatMath.cos(radian);
+ float sinTheta = FloatMath.sin(radian);
float scale = length / (length + sinTheta * base[1]);
vertices[0] = base[0] * scale;