summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-12-11 14:42:27 -0800
committerJohn Reck <jreck@google.com>2012-12-11 14:58:14 -0800
commit8cb165add72646ba57cf2f072d91351a8544fbc5 (patch)
treec7f6b927b17fb1fc07d6b8211216ac0bd59a27f9 /tests/src/com/android
parent203b6826f9958fbafd1a92b4a99d8d9e20e8b248 (diff)
downloadandroid_packages_apps_Snap-8cb165add72646ba57cf2f072d91351a8544fbc5.zip
android_packages_apps_Snap-8cb165add72646ba57cf2f072d91351a8544fbc5.tar.gz
android_packages_apps_Snap-8cb165add72646ba57cf2f072d91351a8544fbc5.tar.bz2
GL packaging refactor
Change-Id: I1d7a95c4f0b91a5ba59030d57cf6865c11b497aa
Diffstat (limited to 'tests/src/com/android')
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLCanvasMock.java (renamed from tests/src/com/android/gallery3d/ui/GLCanvasMock.java)5
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLCanvasTest.java (renamed from tests/src/com/android/gallery3d/ui/GLCanvasTest.java)22
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLMock.java (renamed from tests/src/com/android/gallery3d/ui/GLMock.java)4
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/GLStub.java (renamed from tests/src/com/android/gallery3d/ui/GLStub.java)2
-rw-r--r--tests/src/com/android/gallery3d/glrenderer/TextureTest.java (renamed from tests/src/com/android/gallery3d/ui/TextureTest.java)15
-rw-r--r--tests/src/com/android/gallery3d/ui/GLCanvasStub.java5
-rw-r--r--tests/src/com/android/gallery3d/ui/GLViewMock.java2
7 files changed, 39 insertions, 16 deletions
diff --git a/tests/src/com/android/gallery3d/ui/GLCanvasMock.java b/tests/src/com/android/gallery3d/glrenderer/GLCanvasMock.java
index f8100dd..a57c188 100644
--- a/tests/src/com/android/gallery3d/ui/GLCanvasMock.java
+++ b/tests/src/com/android/gallery3d/glrenderer/GLCanvasMock.java
@@ -14,7 +14,10 @@
* limitations under the License.
*/
-package com.android.gallery3d.ui;
+package com.android.gallery3d.glrenderer;
+
+import com.android.gallery3d.glrenderer.BasicTexture;
+import com.android.gallery3d.ui.GLCanvasStub;
import javax.microedition.khronos.opengles.GL11;
diff --git a/tests/src/com/android/gallery3d/ui/GLCanvasTest.java b/tests/src/com/android/gallery3d/glrenderer/GLCanvasTest.java
index ddbddad..c42f97d 100644
--- a/tests/src/com/android/gallery3d/ui/GLCanvasTest.java
+++ b/tests/src/com/android/gallery3d/glrenderer/GLCanvasTest.java
@@ -14,11 +14,15 @@
* limitations under the License.
*/
-package com.android.gallery3d.ui;
+package com.android.gallery3d.glrenderer;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log;
+import com.android.gallery3d.glrenderer.GLCanvas;
+import com.android.gallery3d.glrenderer.GLES11Canvas;
+import com.android.gallery3d.glrenderer.GLPaint;
+
import junit.framework.TestCase;
import java.util.Arrays;
@@ -39,7 +43,7 @@ public class GLCanvasTest extends TestCase {
@SmallTest
public void testSetSize() {
GL11 glStub = new GLStub();
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(glStub);
canvas.setSize(100, 200);
canvas.setSize(1000, 100);
@@ -58,7 +62,7 @@ public class GLCanvasTest extends TestCase {
private static class ClearBufferTest extends GLMock {
void run() {
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
assertEquals(0, mGLClearCalled);
canvas.clearBuffer();
@@ -81,7 +85,7 @@ public class GLCanvasTest extends TestCase {
0x7F010101, 0xFEFEFDFC, 0x017F8081, 0x027F8081, 0x2ADE4C4D
};
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
canvas.setSize(400, 300);
// Test one color to make sure blend function is set.
@@ -110,7 +114,7 @@ public class GLCanvasTest extends TestCase {
@SmallTest
public void testSetGetMultiplyAlpha() {
GL11 glStub = new GLStub();
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(glStub);
canvas.setAlpha(1f);
@@ -150,7 +154,7 @@ public class GLCanvasTest extends TestCase {
private static class AlphaTest extends GLMock {
void run() {
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
canvas.setSize(400, 300);
@@ -193,7 +197,7 @@ public class GLCanvasTest extends TestCase {
}
void run() {
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
canvas.setSize(400, 300);
canvas.drawLine(2, 7, 1, 8, newColorPaint(0) /* color */);
@@ -238,7 +242,7 @@ public class GLCanvasTest extends TestCase {
}
void run() {
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
canvas.setSize(400, 300);
canvas.fillRect(2, 7, 1, 8, 0 /* color */);
@@ -301,7 +305,7 @@ public class GLCanvasTest extends TestCase {
}
void run() {
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(this);
canvas.setSize(40, 50);
int color = 0;
diff --git a/tests/src/com/android/gallery3d/ui/GLMock.java b/tests/src/com/android/gallery3d/glrenderer/GLMock.java
index c1fe53c..b242217 100644
--- a/tests/src/com/android/gallery3d/ui/GLMock.java
+++ b/tests/src/com/android/gallery3d/glrenderer/GLMock.java
@@ -14,7 +14,9 @@
* limitations under the License.
*/
-package com.android.gallery3d.ui;
+package com.android.gallery3d.glrenderer;
+
+import com.android.gallery3d.ui.PointerInfo;
import java.nio.Buffer;
import java.util.HashMap;
diff --git a/tests/src/com/android/gallery3d/ui/GLStub.java b/tests/src/com/android/gallery3d/glrenderer/GLStub.java
index 2af73f9..4b66040 100644
--- a/tests/src/com/android/gallery3d/ui/GLStub.java
+++ b/tests/src/com/android/gallery3d/glrenderer/GLStub.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.gallery3d.ui;
+package com.android.gallery3d.glrenderer;
import javax.microedition.khronos.opengles.GL;
import javax.microedition.khronos.opengles.GL10;
diff --git a/tests/src/com/android/gallery3d/ui/TextureTest.java b/tests/src/com/android/gallery3d/glrenderer/TextureTest.java
index 361bf7b..b13a333 100644
--- a/tests/src/com/android/gallery3d/ui/TextureTest.java
+++ b/tests/src/com/android/gallery3d/glrenderer/TextureTest.java
@@ -14,12 +14,19 @@
* limitations under the License.
*/
-package com.android.gallery3d.ui;
+package com.android.gallery3d.glrenderer;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.test.suitebuilder.annotation.SmallTest;
+import com.android.gallery3d.glrenderer.BasicTexture;
+import com.android.gallery3d.glrenderer.BitmapTexture;
+import com.android.gallery3d.glrenderer.ColorTexture;
+import com.android.gallery3d.glrenderer.GLCanvas;
+import com.android.gallery3d.glrenderer.GLES11Canvas;
+import com.android.gallery3d.glrenderer.UploadedTexture;
+
import junit.framework.TestCase;
import javax.microedition.khronos.opengles.GL11;
@@ -62,7 +69,7 @@ public class TextureTest extends TestCase {
@SmallTest
public void testBasicTexture() {
GL11 glStub = new GLStub();
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(glStub);
MyBasicTexture texture = new MyBasicTexture(canvas, 47);
@@ -83,7 +90,7 @@ public class TextureTest extends TestCase {
assertTrue(texture.isLoaded());
// For a different GL, it's not loaded.
- GLCanvas canvas2 = new GLCanvasImpl();
+ GLCanvas canvas2 = new GLES11Canvas();
canvas2.initialize(glStub);
assertFalse(texture.isLoaded());
@@ -138,7 +145,7 @@ public class TextureTest extends TestCase {
@SmallTest
public void testUploadedTexture() {
GL11 glStub = new GLStub();
- GLCanvas canvas = new GLCanvasImpl();
+ GLCanvas canvas = new GLES11Canvas();
canvas.initialize(glStub);
MyUploadedTexture texture = new MyUploadedTexture();
diff --git a/tests/src/com/android/gallery3d/ui/GLCanvasStub.java b/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
index e993223..bf4776d 100644
--- a/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
+++ b/tests/src/com/android/gallery3d/ui/GLCanvasStub.java
@@ -19,6 +19,11 @@ package com.android.gallery3d.ui;
import android.graphics.Bitmap;
import android.graphics.RectF;
+import com.android.gallery3d.glrenderer.BasicTexture;
+import com.android.gallery3d.glrenderer.GLCanvas;
+import com.android.gallery3d.glrenderer.GLPaint;
+import com.android.gallery3d.glrenderer.RawTexture;
+
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
diff --git a/tests/src/com/android/gallery3d/ui/GLViewMock.java b/tests/src/com/android/gallery3d/ui/GLViewMock.java
index 7b941da..9b7488f 100644
--- a/tests/src/com/android/gallery3d/ui/GLViewMock.java
+++ b/tests/src/com/android/gallery3d/ui/GLViewMock.java
@@ -16,6 +16,8 @@
package com.android.gallery3d.ui;
+import com.android.gallery3d.glrenderer.GLCanvas;
+
class GLViewMock extends GLView {
// onAttachToRoot
int mOnAttachCalled;