packages/apps/Gallery2
修订版 | 508d9e47f47c0cbe40285c4e1c5f8f98f479de46 (tree) |
---|---|
时间 | 2017-02-22 03:10:01 |
作者 | Paul Duffin <paulduffin@goog...> |
Commiter | android-build-merger |
Merge "Stop using junit classes in production" am: f1ec8df547
am: d382e794e9
Change-Id: I43e1638614a6076b0a664352367adce76cf80787
@@ -18,7 +18,7 @@ package com.android.gallery3d.glrenderer; | ||
18 | 18 | |
19 | 19 | import android.graphics.Bitmap; |
20 | 20 | |
21 | -import junit.framework.Assert; | |
21 | +import com.android.gallery3d.common.Utils; | |
22 | 22 | |
23 | 23 | // BitmapTexture is a texture whose content is specified by a fixed Bitmap. |
24 | 24 | // |
@@ -34,7 +34,7 @@ public class BitmapTexture extends UploadedTexture { | ||
34 | 34 | |
35 | 35 | public BitmapTexture(Bitmap bitmap, boolean hasBorder) { |
36 | 36 | super(hasBorder); |
37 | - Assert.assertTrue(bitmap != null && !bitmap.isRecycled()); | |
37 | + Utils.assertTrue(bitmap != null && !bitmap.isRecycled()); | |
38 | 38 | mContentBitmap = bitmap; |
39 | 39 | } |
40 | 40 |
@@ -27,8 +27,6 @@ import android.util.Log; | ||
27 | 27 | import com.android.gallery3d.common.Utils; |
28 | 28 | import com.android.gallery3d.util.IntArray; |
29 | 29 | |
30 | -import junit.framework.Assert; | |
31 | - | |
32 | 30 | import java.nio.Buffer; |
33 | 31 | import java.nio.ByteBuffer; |
34 | 32 | import java.nio.ByteOrder; |
@@ -126,7 +124,7 @@ public class GLES11Canvas implements GLCanvas { | ||
126 | 124 | |
127 | 125 | @Override |
128 | 126 | public void setSize(int width, int height) { |
129 | - Assert.assertTrue(width >= 0 && height >= 0); | |
127 | + Utils.assertTrue(width >= 0 && height >= 0); | |
130 | 128 | |
131 | 129 | if (mTargetTexture == null) { |
132 | 130 | mScreenWidth = width; |
@@ -154,7 +152,7 @@ public class GLES11Canvas implements GLCanvas { | ||
154 | 152 | |
155 | 153 | @Override |
156 | 154 | public void setAlpha(float alpha) { |
157 | - Assert.assertTrue(alpha >= 0 && alpha <= 1); | |
155 | + Utils.assertTrue(alpha >= 0 && alpha <= 1); | |
158 | 156 | mAlpha = alpha; |
159 | 157 | } |
160 | 158 |
@@ -165,7 +163,7 @@ public class GLES11Canvas implements GLCanvas { | ||
165 | 163 | |
166 | 164 | @Override |
167 | 165 | public void multiplyAlpha(float alpha) { |
168 | - Assert.assertTrue(alpha >= 0 && alpha <= 1); | |
166 | + Utils.assertTrue(alpha >= 0 && alpha <= 1); | |
169 | 167 | mAlpha *= alpha; |
170 | 168 | } |
171 | 169 |
@@ -16,7 +16,7 @@ | ||
16 | 16 | |
17 | 17 | package com.android.gallery3d.glrenderer; |
18 | 18 | |
19 | -import junit.framework.Assert; | |
19 | +import com.android.gallery3d.common.Utils; | |
20 | 20 | |
21 | 21 | public class GLPaint { |
22 | 22 | private float mLineWidth = 1f; |
@@ -31,7 +31,7 @@ public class GLPaint { | ||
31 | 31 | } |
32 | 32 | |
33 | 33 | public void setLineWidth(float width) { |
34 | - Assert.assertTrue(width >= 0); | |
34 | + Utils.assertTrue(width >= 0); | |
35 | 35 | mLineWidth = width; |
36 | 36 | } |
37 | 37 |
@@ -20,7 +20,7 @@ import android.content.Context; | ||
20 | 20 | import android.graphics.Bitmap; |
21 | 21 | import android.graphics.BitmapFactory; |
22 | 22 | |
23 | -import junit.framework.Assert; | |
23 | +import com.android.gallery3d.common.Utils; | |
24 | 24 | |
25 | 25 | // ResourceTexture is a texture whose Bitmap is decoded from a resource. |
26 | 26 | // By default ResourceTexture is not opaque. |
@@ -30,7 +30,7 @@ public class ResourceTexture extends UploadedTexture { | ||
30 | 30 | protected final int mResId; |
31 | 31 | |
32 | 32 | public ResourceTexture(Context context, int resId) { |
33 | - Assert.assertNotNull(context); | |
33 | + Utils.checkNotNull(context); | |
34 | 34 | mContext = context; |
35 | 35 | mResId = resId; |
36 | 36 | setOpaque(false); |
@@ -20,7 +20,7 @@ import android.graphics.Bitmap; | ||
20 | 20 | import android.graphics.Bitmap.Config; |
21 | 21 | import android.opengl.GLUtils; |
22 | 22 | |
23 | -import junit.framework.Assert; | |
23 | +import com.android.gallery3d.common.Utils; | |
24 | 24 | |
25 | 25 | import java.util.HashMap; |
26 | 26 |
@@ -144,7 +144,7 @@ public abstract class UploadedTexture extends BasicTexture { | ||
144 | 144 | } |
145 | 145 | |
146 | 146 | private void freeBitmap() { |
147 | - Assert.assertTrue(mBitmap != null); | |
147 | + Utils.assertTrue(mBitmap != null); | |
148 | 148 | onFreeBitmap(mBitmap); |
149 | 149 | mBitmap = null; |
150 | 150 | } |
@@ -219,7 +219,7 @@ public abstract class UploadedTexture extends BasicTexture { | ||
219 | 219 | int texWidth = getTextureWidth(); |
220 | 220 | int texHeight = getTextureHeight(); |
221 | 221 | |
222 | - Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight); | |
222 | + Utils.assertTrue(bWidth <= texWidth && bHeight <= texHeight); | |
223 | 223 | |
224 | 224 | // Upload the bitmap to a new texture. |
225 | 225 | mId = canvas.getGLId().generateTexture(); |