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.
//
public BitmapTexture(Bitmap bitmap, boolean hasBorder) {
super(hasBorder);
- Assert.assertTrue(bitmap != null && !bitmap.isRecycled());
+ Utils.assertTrue(bitmap != null && !bitmap.isRecycled());
mContentBitmap = bitmap;
}
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;
@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;
@Override
public void setAlpha(float alpha) {
- Assert.assertTrue(alpha >= 0 && alpha <= 1);
+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha = alpha;
}
@Override
public void multiplyAlpha(float alpha) {
- Assert.assertTrue(alpha >= 0 && alpha <= 1);
+ Utils.assertTrue(alpha >= 0 && alpha <= 1);
mAlpha *= alpha;
}
package com.android.gallery3d.glrenderer;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
public class GLPaint {
private float mLineWidth = 1f;
}
public void setLineWidth(float width) {
- Assert.assertTrue(width >= 0);
+ Utils.assertTrue(width >= 0);
mLineWidth = width;
}
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.
protected final int mResId;
public ResourceTexture(Context context, int resId) {
- Assert.assertNotNull(context);
+ Utils.checkNotNull(context);
mContext = context;
mResId = resId;
setOpaque(false);
import android.graphics.Bitmap.Config;
import android.opengl.GLUtils;
-import junit.framework.Assert;
+import com.android.gallery3d.common.Utils;
import java.util.HashMap;
}
private void freeBitmap() {
- Assert.assertTrue(mBitmap != null);
+ Utils.assertTrue(mBitmap != null);
onFreeBitmap(mBitmap);
mBitmap = null;
}
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();