summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-11-30 15:08:05 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-30 15:08:05 -0800
commit8d26578f8db895dadb7e0e1d7a56c00fa18183ec (patch)
tree83b8b09301a0ac89aded3951337364d11ec9e81e /tests
parent85ea4b74e2c18576e2d0191eef804c6e2d2e65a7 (diff)
parent0db6ec1a2d602a48437a48ae47fbca01299fdcea (diff)
downloadandroid_packages_apps_Snap-8d26578f8db895dadb7e0e1d7a56c00fa18183ec.tar.gz
android_packages_apps_Snap-8d26578f8db895dadb7e0e1d7a56c00fa18183ec.tar.bz2
android_packages_apps_Snap-8d26578f8db895dadb7e0e1d7a56c00fa18183ec.zip
Merge "Separate GL calls into GLCanvas in preparation for adding GLES2." into gb-ub-photos-bryce
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/gallery3d/ui/GLCanvasStub.java70
-rw-r--r--tests/src/com/android/gallery3d/ui/GLCanvasTest.java7
2 files changed, 69 insertions, 8 deletions
diff --git a/tests/src/com/android/gallery3d/ui/GLCanvasStub.java b/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
index 5a08b8599..afa34acf3 100644
--- a/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
+++ b/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
@@ -16,52 +16,76 @@
package com.android.gallery3d.ui;
+import android.graphics.Bitmap;
import android.graphics.RectF;
+import java.nio.Buffer;
+
import javax.microedition.khronos.opengles.GL11;
-public class GLCanvasStub implements GLCanvas {
+public class GLCanvasStub extends GLCanvas {
+ @Override
public void setSize(int width, int height) {}
+ @Override
public void clearBuffer() {}
+ @Override
public void clearBuffer(float[] argb) {}
public void setCurrentAnimationTimeMillis(long time) {}
public long currentAnimationTimeMillis() {
throw new UnsupportedOperationException();
}
+ @Override
public void setAlpha(float alpha) {}
+ @Override
public float getAlpha() {
throw new UnsupportedOperationException();
}
+ @Override
public void multiplyAlpha(float alpha) {}
+ @Override
public void translate(float x, float y, float z) {}
+ @Override
public void translate(float x, float y) {}
+ @Override
public void scale(float sx, float sy, float sz) {}
+ @Override
public void rotate(float angle, float x, float y, float z) {}
public boolean clipRect(int left, int top, int right, int bottom) {
throw new UnsupportedOperationException();
}
+ @Override
public void save() {
throw new UnsupportedOperationException();
}
+ @Override
public void save(int saveFlags) {
throw new UnsupportedOperationException();
}
public void setBlendEnabled(boolean enabled) {}
+ @Override
public void restore() {}
+ @Override
public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {}
+ @Override
public void drawRect(float x1, float y1, float x2, float y2, GLPaint paint) {}
+ @Override
public void fillRect(float x, float y, float width, float height, int color) {}
+ @Override
public void drawTexture(
BasicTexture texture, int x, int y, int width, int height) {}
+ @Override
public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer,
int uvBuffer, int indexBuffer, int indexCount) {}
public void drawTexture(BasicTexture texture,
int x, int y, int width, int height, float alpha) {}
+ @Override
public void drawTexture(BasicTexture texture, RectF source, RectF target) {}
+ @Override
public void drawTexture(BasicTexture texture, float[] mTextureTransform,
int x, int y, int w, int h) {}
public void drawMixed(BasicTexture from, BasicTexture to,
float ratio, int x, int y, int w, int h) {}
+ @Override
public void drawMixed(BasicTexture from, int to,
float ratio, int x, int y, int w, int h) {}
public void drawMixed(BasicTexture from, BasicTexture to,
@@ -72,17 +96,61 @@ public class GLCanvasStub implements GLCanvas {
public GL11 getGLInstance() {
throw new UnsupportedOperationException();
}
+ @Override
public boolean unloadTexture(BasicTexture texture) {
throw new UnsupportedOperationException();
}
+ @Override
public void deleteBuffer(int bufferId) {
throw new UnsupportedOperationException();
}
+ @Override
public void deleteRecycledResources() {}
+ @Override
public void multiplyMatrix(float[] mMatrix, int offset) {}
+ @Override
public void dumpStatisticsAndClear() {}
+ @Override
public void beginRenderTarget(RawTexture texture) {}
+ @Override
public void endRenderTarget() {}
+ @Override
public void drawMixed(BasicTexture from, int toColor,
float ratio, RectF src, RectF target) {}
+
+ @Override
+ public void setTextureParameters(BasicTexture texture) {
+ }
+ @Override
+ public void initializeTextureSize(BasicTexture texture, int format, int type) {
+ }
+ @Override
+ public void initializeTexture(BasicTexture texture, Bitmap bitmap) {
+ }
+ @Override
+ public void texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap,
+ int format, int type) {
+ }
+ @Override
+ public int[] uploadBuffers(Buffer[] buffers) {
+ return null;
+ }
+ @Override
+ public void setBlending(Blending blending) {
+ }
+ @Override
+ public void enableStencil() {
+ }
+ @Override
+ public void disableStencil() {
+ }
+ @Override
+ public void clearStencilBuffer() {
+ }
+ @Override
+ public void updateStencil(boolean update) {
+ }
+ @Override
+ public void drawOnlyOutsideStencil(boolean onlyOutside) {
+ }
}
diff --git a/tests/src/com/android/gallery3d/ui/GLCanvasTest.java b/tests/src/com/android/gallery3d/ui/GLCanvasTest.java
index 72ccbfb96..8df7a3dfb 100644
--- a/tests/src/com/android/gallery3d/ui/GLCanvasTest.java
+++ b/tests/src/com/android/gallery3d/ui/GLCanvasTest.java
@@ -359,13 +359,6 @@ public class GLCanvasTest extends TestCase {
}
}
- @SmallTest
- public void testGetGLInstance() {
- GL11 glStub = new GLStub();
- GLCanvas canvas = new GLCanvasImpl(glStub);
- assertSame(glStub, canvas.getGLInstance());
- }
-
private static void assertPremultipliedBlending(GLMock mock) {
assertTrue(mock.mGLBlendFuncCalled > 0);
assertTrue(mock.mGLBlendEnabled);