summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-18 17:31:45 +0200
committerSven Gothel <[email protected]>2013-09-18 17:31:45 +0200
commit5ee2fa951894ee3fdaab7b002e475c173ab5cf17 (patch)
tree4e08567636595054e6b5608f73cd99d6eeae9eec /src
parent31deb28db53c426136805ff8ecb63f93a3bf8247 (diff)
AWTTilePainter: Fix case with no GLOrientation, i.e. no vertical-flip. Tile location and destination must follow same math as w/ vertical-flip.
.. clipping and tile-height was not considered.
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java19
2 files changed, 19 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index a06dbcb3d..f3aba3902 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -212,11 +212,7 @@ public class AWTTilePainter {
renderer.setImageSize(iImageSizeScaled.width, iImageSizeScaled.height);
renderer.clipImageSize(iClipScaled.width, iClipScaled.height);
final int clipH = Math.min(iImageSizeScaled.height, iClipScaled.height);
- if( flipVertical ) {
- renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
- } else {
- renderer.setTileOffset(iClipScaled.x, iClipScaled.y);
- }
+ renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
if( verbose ) {
System.err.println("AWT print.0: image "+dImageSizeOrig + " -> " + dImageSizeScaled + " -> " + iImageSizeScaled);
System.err.println("AWT print.0: clip "+gClipOrigR + " -> " + dClipOrig + " -> " + dClipScaled + " -> " + iClipScaled);
@@ -290,12 +286,7 @@ public class AWTTilePainter {
final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS);
final int pY = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS);
final int pYOff = renderer.getParam(TileRenderer.TR_TILE_Y_OFFSET);
- final int pYf;
- if( flipVertical ) {
- pYf = cis.getHeight() - ( pY - pYOff + tHeight ) + scaledYOffset;
- } else {
- pYf = pY;
- }
+ final int pYf = cis.getHeight() - ( pY - pYOff + tHeight ) + scaledYOffset;
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
index 72f4871b8..f331f5d88 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
@@ -64,7 +64,7 @@ import com.jogamp.newt.event.TraceKeyAdapter;
import com.jogamp.newt.event.TraceWindowAdapter;
import com.jogamp.newt.event.awt.AWTKeyAdapter;
import com.jogamp.newt.event.awt.AWTWindowAdapter;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
@@ -120,7 +120,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
} else {
glJPanel2.setBounds(0, 0, glc_sz.width, glc_sz.height);
}
- glJPanel2.addGLEventListener(new RedSquareES2());
+ glJPanel2.addGLEventListener(new RedSquareES1());
// glJPanel2.addGLEventListener(new Gears());
final JComponent demoPanel;
@@ -273,6 +273,21 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
}
@Test
+ public void test01_aa0_bitmap() throws InterruptedException, InvocationTargetException {
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setBitmap(true);
+ runTestGL(caps, false);
+ }
+
+ @Test
+ public void test01_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
+ GLCapabilities caps = new GLCapabilities(glp);
+ caps.setBitmap(true);
+ caps.setAlphaBits(8);
+ runTestGL(caps, true);
+ }
+
+ @Test
public void test02_aa8() throws InterruptedException, InvocationTargetException {
GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);