aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
Commit message (Collapse)AuthorAgeFilesLines
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-18/+18
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Bug 904: 'User Vertical Flip' for GLJPanel w/o vertical flip must be ↵Sven Gothel2013-12-101-5/+16
| | | | considered in AWTTilePainter: 'Origin of GL image is still on Bottom'
* jogl: add missing @Override annotationsHarvey Harrison2013-10-171-0/+1
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-171-37/+37
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* AWTPrintLifecycle.setupPrint(..): Add optional tileWidth and tileHeight, ↵Sven Gothel2013-10-151-8/+13
| | | | allowing user to set custom tile size for performance evaluation/tweak
* Bug 860 - AWT Printing (AWTTilePainter): Shall use the enclosing integer ↵Sven Gothel2013-10-121-7/+2
| | | | | | | | | | | | | | | | | rectangle of the scaled double precision clipping rect AWTTilePainter simply rounds the scaled double precision clipping rectangle to receive the integer rectangle. This leads to uncovered drawing areas, since the integer rectangle position could be greater - and the size could be smaller than the double precision source. To get the enclosing rectangle, we need to use iPos = floor(position) iSize = ceil(position+size) - floor(position) .. turns our that the double precision 'Rectangle Rectangle2D.getBounds()' already performs this math.
* AWTTilePainter: Avoid NPE if Graphic2D's AffineTransform is null, use ↵Sven Gothel2013-10-031-5/+12
| | | | identity tranform in such case.
* TileRenderer*: TileRendererNotify -> TileRendererListener w/ clarifying ↵Sven Gothel2013-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | functionality (reshapeTile(..), ..); Only process GLEventListener impl. TileRendererListener; attachToAutoDrawable -> attachAutoDrawable, etc. -TileRendererNotify -> TileRendererListener - Added methods: - void reshapeTile(TileRendererBase tr,int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight); - void startTileRendering(TileRendererBase tr); - void endTileRendering(TileRendererBase tr); allowing to clarify user code and API specification, i.e. TR only processes GLEventListener which impl. TileRendererListener. This also allows simplifying the API doc, while having a more descriptive reshape method focusing solely on tile rendering. Further more, the start/end TR methods allow certain GL related actions while the context is current before and after iterating through the tiles. This is even used for RandomTileRenderer (one tile only), to allow to reuse same TileRendererListener for diff TRs. - Fix language, attach and detach usage was vice versa. We do attach an GLAutoDrawable to a TR - attachToAutoDrawable -> attachAutoDrawable - detachFromAutoDrawable -> detachAutoDrawable - Adapted unit tests.
* AWT Printing: Fix non vertical-flipped printing, i.e. cut-off top-row's tile ↵Sven Gothel2013-09-201-19/+20
| | | | | | | | | | | | | | | upper area, cleanup. TestTiledPrintingGearsSwingAWT2: Provoked !flipped bug where top-row was positioned too low due to using full size tile-height. Cutting of the unused top-row's upper area corrects this issue. vertical-flip mode does not expose this situation, since flipping shifts the payload to the upper tile area. TestTiledPrintingGearsSwingAWT2: Also tests an alternative transparent overlapping mode without layout.
* AWTTilePainter.setupGraphics2DAndClipBounds(): Use 'Shape getClip()'; Use ↵Sven Gothel2013-09-191-31/+42
| | | | | | | | | | | | | | | | double precicion clip bounds 'all the way'; Explicitly scale image and clip w/ current scaled transform. - Use 'Shape getClip()' Don't assume Rectangle2D, but use Shape's getBounds2D() - Use double precicion clip bounds 'all the way' Remove rounding error on clip bounds w/ start value, which was _not_ using doubles. - Explicitly scale image and clip w/ current scaled transform. Instead of abusing Graphics2D's clip shape to scale image size and clip-area, explicitly use transform both bounding boxes into transformed space, scale space and transform out (inversion). A possible NoninvertibleTransformException will be thrown while Graphics2D has not been modified.
* AWTTilePainter: Fix case with no GLOrientation, i.e. no vertical-flip. Tile ↵Sven Gothel2013-09-181-11/+2
| | | | | | location and destination must follow same math as w/ vertical-flip. .. clipping and tile-height was not considered.
* AWTTilePainter: Fix DEBUG message (used wrong value at println)Sven Gothel2013-09-181-1/+1
|
* Print Tests: Split 'Printable' to own class, add OffscreenPrintable using ↵Sven Gothel2013-09-171-1/+1
| | | | NIO BufferedImage, adding OffscreenPrintable tests to all unit tests.
* Fix AWT printing issues w/ overlapping and/or non-opaque contents ; Change ↵Sven Gothel2013-09-151-45/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AWTPrintLifecycle's lifecycle - AWTPrintLifecycle: - Should decorate: PrinterJob.print(..), instead of within Printable.print(..) { .. container.printAll(..); .. } This is due to AWT print implementation, i.e. AWT will issue Printable.print(..) multiple times for 'overlapping' or non-opaque elements! - Move from javax.media.opengl.awt -> com.jogamp.nativewindow.awt - Make _interface_ AWT agnostic, i.e. remove Graphics2D from 'setup(..)' - Add 'int numSamples' to 'setup(..)' to determine the number of samples - AWTTilePrinter: - Use double precision when scaling image-size and clip-rect, then round them to integer values. Otherwise AWT will use the bounding box for the clipping-rectangular. - Clip negative portion of clip-rect, this removes redundant overpaints, as well as increasing the tile count due to the increased clipping-size. - Clip the image-size in the tile-renderer according to the clip-rect. - DEBUG_TILES: Dump tiles to file - Use sub-image of final BuffereImage instead of adding another clipping region. This might increase performance if no clip-rect has been set. TODO: TestTiledPrintingGearsSwingAWT overlapping tests exposes a 'off by one' bug of the first layer's background! Note: The GL content seems to be correct though - maybe it's simply an AWT rounding error ..
* AWTTilePainter: Fix null clip-rect (consider scaling); Fix non GL-oriented ↵Sven Gothel2013-09-131-31/+55
| | | | drawable, skip vertical flip and use 1:1 y-coord.
* AWT Printing: AWTTilePainter needs to handle null clip!Sven Gothel2013-09-101-6/+10
|
* Add AWTTilePainter.dumpHintsAndScale(..), removing more duplicated code from ↵Sven Gothel2013-09-081-0/+17
| | | | GLCanvas/GLJPanel
* Test: Don't resize frame, tweek print-matrix; AWTPrintLifecycle: Add scale ↵Sven Gothel2013-09-081-18/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and convenient AWT container traversal context; GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - Test: Don't resize frame, tweek print-matrix - Use scaleComp72 to scale the frame to fit on page, i.e. global print matrix - Use scaleGLMatXY = 72.0 / glDPI to locally scale on the GL drawable as being passed to AWTPrintLifecycle.setup(..) - Hence frame stays untouched/stable, no need for 'offscreen' print test, which is removed. - AWTPrintLifecycle: Add scale and convenient AWT container traversal context Use a simple decoration for all AWTPrintLifecycle impl. components within a container: final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, g2d, scaleGLMatXY, scaleGLMatXY); try { } finally { ctx.releasePrint(); } - GLCanvas/GLJPanel properly handle existing MSAA and req. AA; - GLCanvas: Workaround bug where onscreen MSAA cannot switch to offscreen FBO, i.e. stay 'onscreen' - GLJPanel: Use new offscreen FBO if MSAA is requested and not yet used. - GLJPanel.Offscreen.postGL(): always swapBufer(), was missing for !GLSL swapping Results GLCanvas / GLJPanel: - Good scaling - Stable behavior / visibility - High DPI mode works
* AWT/GL Printing WIP: Abstract AWT tile painting code out to AWTTilePainter, ↵Sven Gothel2013-09-071-0/+217
reused w/ GLCanvas and GLJPanel