summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-02-21 18:10:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-02-21 18:10:01 +0000
commit508d9e47f47c0cbe40285c4e1c5f8f98f479de46 (patch)
tree00c8dd1dc906ce711a5c2d9db4790296abf86f38
parentbd7fc276ef38246b154828686cc17a7ca7d623af (diff)
parentd382e794e9b5391c1d1e2c5b58e5429fa33d992c (diff)
downloadandroid_packages_apps_Gallery2-508d9e47f47c0cbe40285c4e1c5f8f98f479de46.tar.gz
android_packages_apps_Gallery2-508d9e47f47c0cbe40285c4e1c5f8f98f479de46.tar.bz2
android_packages_apps_Gallery2-508d9e47f47c0cbe40285c4e1c5f8f98f479de46.zip
Merge "Stop using junit classes in production" am: f1ec8df547
am: d382e794e9 Change-Id: I43e1638614a6076b0a664352367adce76cf80787
-rw-r--r--src/com/android/gallery3d/glrenderer/BitmapTexture.java4
-rw-r--r--src/com/android/gallery3d/glrenderer/GLES11Canvas.java8
-rw-r--r--src/com/android/gallery3d/glrenderer/GLPaint.java4
-rw-r--r--src/com/android/gallery3d/glrenderer/ResourceTexture.java4
-rw-r--r--src/com/android/gallery3d/glrenderer/UploadedTexture.java6
5 files changed, 12 insertions, 14 deletions
diff --git a/src/com/android/gallery3d/glrenderer/BitmapTexture.java b/src/com/android/gallery3d/glrenderer/BitmapTexture.java
index 100b0b3b9..f8b01cb42 100644
--- a/src/com/android/gallery3d/glrenderer/BitmapTexture.java
+++ b/src/com/android/gallery3d/glrenderer/BitmapTexture.java
@@ -18,7 +18,7 @@ package com.android.gallery3d.glrenderer;
import android.graphics.Bitmap;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
// BitmapTexture is a texture whose content is specified by a fixed Bitmap.
//
@@ -34,7 +34,7 @@ public class BitmapTexture extends UploadedTexture {
public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
super(hasBorder);
- Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
+ Utils.assertTrue(bitmap != null && !bitmap.isRecycled());
mContentBitmap = bitmap;
}
diff --git a/src/com/android/gallery3d/glrenderer/GLES11Canvas.java b/src/com/android/gallery3d/glrenderer/GLES11Canvas.java
index 7013c3d1f..74ccfb57b 100644
--- a/src/com/android/gallery3d/glrenderer/GLES11Canvas.java
+++ b/src/com/android/gallery3d/glrenderer/GLES11Canvas.java
@@ -27,8 +27,6 @@ import android.util.Log;
import com.android.gallery3d.common.Utils;
import com.android.gallery3d.util.IntArray;
-import junit.framework.Assert;
-
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -126,7 +124,7 @@ public class GLES11Canvas implements GLCanvas {
@Override
public void setSize(int width, int height) {
- Assert.assertTrue(width >= 0 && height >= 0);
+ Utils.assertTrue(width >= 0 && height >= 0);
if (mTargetTexture == null) {
mScreenWidth = width;
@@ -154,7 +152,7 @@ public class GLES11Canvas implements GLCanvas {
@Override
public void setAlpha(float alpha) {
- Assert.assertTrue(alpha >= 0 && alpha <= 1);
+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha = alpha;
}
@@ -165,7 +163,7 @@ public class GLES11Canvas implements GLCanvas {
@Override
public void multiplyAlpha(float alpha) {
- Assert.assertTrue(alpha >= 0 && alpha <= 1);
+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha *= alpha;
}
diff --git a/src/com/android/gallery3d/glrenderer/GLPaint.java b/src/com/android/gallery3d/glrenderer/GLPaint.java
index 16b220690..b26e9ab29 100644
--- a/src/com/android/gallery3d/glrenderer/GLPaint.java
+++ b/src/com/android/gallery3d/glrenderer/GLPaint.java
@@ -16,7 +16,7 @@
package com.android.gallery3d.glrenderer;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
public class GLPaint {
private float mLineWidth = 1f;
@@ -31,7 +31,7 @@ public class GLPaint {
}
public void setLineWidth(float width) {
- Assert.assertTrue(width >= 0);
+ Utils.assertTrue(width >= 0);
mLineWidth = width;
}
diff --git a/src/com/android/gallery3d/glrenderer/ResourceTexture.java b/src/com/android/gallery3d/glrenderer/ResourceTexture.java
index eb8e8a517..a091fb204 100644
--- a/src/com/android/gallery3d/glrenderer/ResourceTexture.java
+++ b/src/com/android/gallery3d/glrenderer/ResourceTexture.java
@@ -20,7 +20,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
// ResourceTexture is a texture whose Bitmap is decoded from a resource.
// By default ResourceTexture is not opaque.
@@ -30,7 +30,7 @@ public class ResourceTexture extends UploadedTexture {
protected final int mResId;
public ResourceTexture(Context context, int resId) {
- Assert.assertNotNull(context);
+ Utils.checkNotNull(context);
mContext = context;
mResId = resId;
setOpaque(false);
diff --git a/src/com/android/gallery3d/glrenderer/UploadedTexture.java b/src/com/android/gallery3d/glrenderer/UploadedTexture.java
index f41a979b7..417102a38 100644
--- a/src/com/android/gallery3d/glrenderer/UploadedTexture.java
+++ b/src/com/android/gallery3d/glrenderer/UploadedTexture.java
@@ -20,7 +20,7 @@ import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.opengl.GLUtils;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
import java.util.HashMap;
@@ -144,7 +144,7 @@ public abstract class UploadedTexture extends BasicTexture {
}
private void freeBitmap() {
- Assert.assertTrue(mBitmap != null);
+ Utils.assertTrue(mBitmap != null);
onFreeBitmap(mBitmap);
mBitmap = null;
}
@@ -219,7 +219,7 @@ public abstract class UploadedTexture extends BasicTexture {
int texWidth = getTextureWidth();
int texHeight = getTextureHeight();
- Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
+ Utils.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
// Upload the bitmap to a new texture.
mId = canvas.getGLId().generateTexture();