diff options
author | Sven Gothel <[email protected]> | 2013-07-02 22:24:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-02 22:24:08 +0200 |
commit | 35fcf49d1cb49e3844e7cee44f34d827d8a102ce (patch) | |
tree | 1d58dedd28a0d3819431c7142387a5fa220a6718 | |
parent | 4c34f5980bddcdc84b10cb3bcbb96b365b9d471e (diff) |
Bug 724: Add manual unit test, incr. PNGImage verbosity.
-rw-r--r-- | make/scripts/tests.sh | 7 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java | 3 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java | 13 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage00NEWT.java (renamed from src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java) | 4 |
4 files changed, 16 insertions, 11 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 5f0cdf7fa..c0c4764fb 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -206,7 +206,7 @@ function jrun() { #D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all" #D_ARGS="-Dnewt.debug=all" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GLJPanel" - #D_ARGS="-Djogl.debug.PNGImage" + D_ARGS="-Djogl.debug.PNGImage" #D_ARGS="-Djogl.debug.JPEGImage" #D_ARGS="-Djogl.debug.GLDrawable -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser" #X_ARGS="-Dsun.java2d.noddraw=True -Dsun.java2d.opengl=True -Dsun.java2d.xrender=false" @@ -408,7 +408,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01cNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01dNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aNEWT $* -testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $* +#testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03aNEWT $* #testnoawt -Djava.awt.headless=true com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowWarpPointer01NEWT $* @@ -545,7 +545,8 @@ testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTCompareNewtAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTBenchmarkNewtAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGTextureFromFileNEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGImage01NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGImage00NEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGImage01NEWT $* #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGTextureFromFileAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGTextureFromFileNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite01AWT $* diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java index b4b00e744..93d37029e 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java @@ -177,7 +177,8 @@ public class PNGImage { } if(DEBUG) { System.err.println("PNGImage: "+imgInfo); - System.err.println("PNGImage: indexed "+indexed+", alpha "+hasAlpha+", channels "+channels+", bytesPerPixel "+bytesPerPixel+ + System.err.println("PNGImage: indexed "+indexed+", alpha "+hasAlpha+", channels "+channels+"/"+imgInfo.channels+ + ", bytesPerPixel "+bytesPerPixel+"/"+imgInfo.bytesPixel+ ", pixels "+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+"x"+dpi[1]+", glFormat 0x"+Integer.toHexString(glFormat)); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java index 622df8695..f6b6d2873 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java @@ -56,14 +56,18 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A PMVMatrix pmvMatrix; GLUniformData pmvMatrixUniform; GLArrayDataServer interleavedVBO; - + float[] clearColor = new float[] { 1.0f, 1.0f, 1.0f, 0.4f }; public TextureDraw01ES2Listener(TextureData td) { this.textureData = td; } + + public void setClearColor(float[] clearColor) { + this.clearColor = clearColor; + } static final String shaderBasename = "texture01_xxx"; - + private void initShader(GL2ES2 gl, boolean use_program) { // Create & Compile the shader objects ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), @@ -134,7 +138,7 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A st.ownAttribute(interleavedVBO, true); // OpenGL Render Settings - gl.glClearColor(0, 0, 0, 1); + gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); gl.glEnable(GL2ES2.GL_DEPTH_TEST); st.useProgram(gl, false); } @@ -164,8 +168,7 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A gl.glViewport(0, 0, width, height); // Clear background to white - gl.glClearColor(1.0f, 1.0f, 1.0f, 0.4f); - + gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); if(null != st) { pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage00NEWT.java index 81f64f0ae..210d03afa 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGImage00NEWT.java @@ -12,7 +12,7 @@ import com.jogamp.common.util.IOUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.util.texture.spi.PNGImage; -public class TestPNGImage01NEWT extends UITestCase { +public class TestPNGImage00NEWT extends UITestCase { @Test public void testPNGReadWriteAndCompare() throws InterruptedException, IOException, MalformedURLException { final File out1_f=new File(getSimpleTestName(".")+"-PNGImageTest1.png"); @@ -57,6 +57,6 @@ public class TestPNGImage01NEWT extends UITestCase { } public static void main(String args[]) { - org.junit.runner.JUnitCore.main(TestPNGImage01NEWT.class.getName()); + org.junit.runner.JUnitCore.main(TestPNGImage00NEWT.class.getName()); } } |