• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Gallery2


Commit MetaInfo

修订版508d9e47f47c0cbe40285c4e1c5f8f98f479de46 (tree)
时间2017-02-22 03:10:01
作者Paul Duffin <paulduffin@goog...>
Commiterandroid-build-merger

Log Message

Merge "Stop using junit classes in production" am: f1ec8df547
am: d382e794e9

Change-Id: I43e1638614a6076b0a664352367adce76cf80787

更改概述

差异

--- 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;
1818
1919 import android.graphics.Bitmap;
2020
21-import junit.framework.Assert;
21+import com.android.gallery3d.common.Utils;
2222
2323 // BitmapTexture is a texture whose content is specified by a fixed Bitmap.
2424 //
@@ -34,7 +34,7 @@ public class BitmapTexture extends UploadedTexture {
3434
3535 public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
3636 super(hasBorder);
37- Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
37+ Utils.assertTrue(bitmap != null && !bitmap.isRecycled());
3838 mContentBitmap = bitmap;
3939 }
4040
--- a/src/com/android/gallery3d/glrenderer/GLES11Canvas.java
+++ b/src/com/android/gallery3d/glrenderer/GLES11Canvas.java
@@ -27,8 +27,6 @@ import android.util.Log;
2727 import com.android.gallery3d.common.Utils;
2828 import com.android.gallery3d.util.IntArray;
2929
30-import junit.framework.Assert;
31-
3230 import java.nio.Buffer;
3331 import java.nio.ByteBuffer;
3432 import java.nio.ByteOrder;
@@ -126,7 +124,7 @@ public class GLES11Canvas implements GLCanvas {
126124
127125 @Override
128126 public void setSize(int width, int height) {
129- Assert.assertTrue(width >= 0 && height >= 0);
127+ Utils.assertTrue(width >= 0 && height >= 0);
130128
131129 if (mTargetTexture == null) {
132130 mScreenWidth = width;
@@ -154,7 +152,7 @@ public class GLES11Canvas implements GLCanvas {
154152
155153 @Override
156154 public void setAlpha(float alpha) {
157- Assert.assertTrue(alpha >= 0 && alpha <= 1);
155+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
158156 mAlpha = alpha;
159157 }
160158
@@ -165,7 +163,7 @@ public class GLES11Canvas implements GLCanvas {
165163
166164 @Override
167165 public void multiplyAlpha(float alpha) {
168- Assert.assertTrue(alpha >= 0 && alpha <= 1);
166+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
169167 mAlpha *= alpha;
170168 }
171169
--- a/src/com/android/gallery3d/glrenderer/GLPaint.java
+++ b/src/com/android/gallery3d/glrenderer/GLPaint.java
@@ -16,7 +16,7 @@
1616
1717 package com.android.gallery3d.glrenderer;
1818
19-import junit.framework.Assert;
19+import com.android.gallery3d.common.Utils;
2020
2121 public class GLPaint {
2222 private float mLineWidth = 1f;
@@ -31,7 +31,7 @@ public class GLPaint {
3131 }
3232
3333 public void setLineWidth(float width) {
34- Assert.assertTrue(width >= 0);
34+ Utils.assertTrue(width >= 0);
3535 mLineWidth = width;
3636 }
3737
--- a/src/com/android/gallery3d/glrenderer/ResourceTexture.java
+++ b/src/com/android/gallery3d/glrenderer/ResourceTexture.java
@@ -20,7 +20,7 @@ import android.content.Context;
2020 import android.graphics.Bitmap;
2121 import android.graphics.BitmapFactory;
2222
23-import junit.framework.Assert;
23+import com.android.gallery3d.common.Utils;
2424
2525 // ResourceTexture is a texture whose Bitmap is decoded from a resource.
2626 // By default ResourceTexture is not opaque.
@@ -30,7 +30,7 @@ public class ResourceTexture extends UploadedTexture {
3030 protected final int mResId;
3131
3232 public ResourceTexture(Context context, int resId) {
33- Assert.assertNotNull(context);
33+ Utils.checkNotNull(context);
3434 mContext = context;
3535 mResId = resId;
3636 setOpaque(false);
--- a/src/com/android/gallery3d/glrenderer/UploadedTexture.java
+++ b/src/com/android/gallery3d/glrenderer/UploadedTexture.java
@@ -20,7 +20,7 @@ import android.graphics.Bitmap;
2020 import android.graphics.Bitmap.Config;
2121 import android.opengl.GLUtils;
2222
23-import junit.framework.Assert;
23+import com.android.gallery3d.common.Utils;
2424
2525 import java.util.HashMap;
2626
@@ -144,7 +144,7 @@ public abstract class UploadedTexture extends BasicTexture {
144144 }
145145
146146 private void freeBitmap() {
147- Assert.assertTrue(mBitmap != null);
147+ Utils.assertTrue(mBitmap != null);
148148 onFreeBitmap(mBitmap);
149149 mBitmap = null;
150150 }
@@ -219,7 +219,7 @@ public abstract class UploadedTexture extends BasicTexture {
219219 int texWidth = getTextureWidth();
220220 int texHeight = getTextureHeight();
221221
222- Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
222+ Utils.assertTrue(bWidth <= texWidth && bHeight <= texHeight);
223223
224224 // Upload the bitmap to a new texture.
225225 mId = canvas.getGLId().generateTexture();