summaryrefslogtreecommitdiffstats
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Test AWT Printing: Frame size contains border/insets, use as-is for scaling; ↵Sven Gothel2013-09-273-25/+22
| | | | Only force TEXT AA print-rendering hint.
* Bug 816: Fix JAWTWindow's getLocationOnScreenNonBlocking(); Derive CALayer ↵Sven Gothel2013-09-273-13/+304
| | | | | | | | | | | | | | | | | | | | | | | position from AWT component's location on screen. Track fixedFrame size of root CALayer; Add Split layout to unit test, add [manual] Applet tests. - Fix JAWTWindow's getLocationOnScreenNonBlocking() Skip JRootPane while traversing up to root Container. JRootPane would duplicate the top-level container's offset (Window insets). - Derive CALayer position from AWT component's location on screen. Add Split layout to unit test, add [manual] Applet tests. AWT >= 7u40: - AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets. - Use getLocationOnScreenNonBlocking() to get location-on-screen w/o insets. - Native code: flip origin AWT < 7u40 still uses fixed position 0/0 for root and sub layer. - Track fixedFrame size of root CALayer - MyCALayer: - Override layoutSublayers to validate root and sub-layer pos/size - Override setFrame to use fixedFrame, if set (similar to MyNSOpenGLLayer) - Add Split layout to unit test, add [manual] Applet tests. - Thx to 'jimthev' and 'Manu' for providing Applet unit tests
* TileRenderer*: TileRendererNotify -> TileRendererListener w/ clarifying ↵Sven Gothel2013-09-277-100/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* DirectDataBufferInt: createBufferedImage(..) use BufferedImage type value ↵Sven Gothel2013-09-278-51/+91
| | | | | | | | | | | | | | | | | | | | | instead of component-count, support all int types ; Add type 'BufferedImageInt' preserving the custom image-type, add note about TYPE_CUSTOM - createBufferedImage(..) use BufferedImage type value instead of component-count, support all int types - Support all integer data image-type, hence we need to pass image-type instead of component count (collision). - Also pass 'properties' to allow configuring all BufferedImage parameters (just in case) - Return BufferedImageInt to allow user to query the used image-type, see below. - Add type 'BufferedImageInt' preserving the custom image-type, add note about TYPE_CUSTOM - Simply extends BufferedImage w/ custom image-type, since BufferedImage's type is TYPE_CUSTOM due to our custom storage type (see API doc comment). Unit tests: - Testing all integer image-type's in - TestTiledPrintingGearsSwingAWT - TestTiledPrintingNIOImageSwingAWT - Disable all AA print-hints, all AWT text visible on X11. Probably has a regression on Windows / OSX .. TBD.
* Fix MovieCube/Simple Demo in 'Applet' mode: Use default ctor to completly ↵Sven Gothel2013-09-254-16/+93
| | | | initialize GLMediaPlayer demo w/ def. stream etc; Fix list of command keys in applet html page.
* Bug 816: Fix OSX CALayer 'quirks' for AWT 1.7.0_40 - See JAWTUtil ↵Sven Gothel2013-09-241-23/+97
| | | | | | | | | JAWT_OSX_CALAYER_QUIRK_SIZE and JAWT_OSX_CALAYER_QUIRK_POSITION. - Provide quirk bits for OSX CALayer depending on used JVM/AWT and act accordingly. - TestBug816OSXCALayerPosAWT: Add resize by frame
* Bug 816: Add unit test 'TestBug816OSXCALayerPosAWT'Sven Gothel2013-09-241-0/+363
|
* AWT Printing: Fix non vertical-flipped printing, i.e. cut-off top-row's tile ↵Sven Gothel2013-09-203-3/+407
| | | | | | | | | | | | | | | 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.
* Fix Bug 826: GLJPanel: Fully restore TextureState and ViewportSven Gothel2013-09-2013-50/+684
| | | | | | | | | | | | In FBO mode save TextureState of current texture-unit, as well as for the fbo texture-unit if the latter is a different. In glslTextureRaster mode for verical flip (using FBO), set the viewport to drawable size if before flipping and restore afterward - if equired. TestGLJPanelTextureStateAWT fully tests use cases: - Keep texture bound w/ same or other texture-unit - Use 2 viewports within one drawable and keep it
* TestTiledPrintingGearsSwingAWT: Enable 'bitmap' test only on Windows, issues ↵Sven Gothel2013-09-191-7/+12
| | | | w/ AMD catalyst driver and pixmap surface ..
* AWT Print Tests: Only include 600dpi tests if requested via main arg '-600dpi'Sven Gothel2013-09-194-4/+8
|
* AWTTilePainter: Fix case with no GLOrientation, i.e. no vertical-flip. Tile ↵Sven Gothel2013-09-181-2/+17
| | | | | | location and destination must follow same math as w/ vertical-flip. .. clipping and tile-height was not considered.
* RedSquareES1: Add TileRendererBase.TileRendererNotifySven Gothel2013-09-181-17/+69
|
* Print Tests: Split 'Printable' to own class, add OffscreenPrintable using ↵Sven Gothel2013-09-177-207/+536
| | | | NIO BufferedImage, adding OffscreenPrintable tests to all unit tests.
* TestTiledPrintingNIOImageSwingAWT: Add layered test ; Use 300dpi instead of ↵Sven Gothel2013-09-161-3/+9
| | | | 600dpi
* Add 'DirectDataBufferInt' supporting NIO based BufferedImagesSven Gothel2013-09-162-2/+298
| | | | | | | | | | - Contains convenient method to create an NIO backed BufferedImage 'BufferedImage createBufferedImage(int width, int height, int numComponents, Point location)' Standalone test TestTiledPrintingNIOImageSwingAWT 'prints', i.e. renders offscreen, the Frame into - a traditional array-backed BufferedImage - an NIO-backed backed BufferedImage
* Fix AWT printing issues w/ overlapping and/or non-opaque contents ; Change ↵Sven Gothel2013-09-154-86/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ..
* Gears, GearsES2, RedSquareES2: Proper debug output for init, reshape and disposeSven Gothel2013-09-113-7/+7
|
* Add 2nd 'demo' canvas to the other tiled printing tests.Sven Gothel2013-09-112-31/+63
|
* RedSquareES2: Fix tiled aspect ratioSven Gothel2013-09-111-1/+1
|
* TestTiledPrintingGearsSwingAWT: Add a second demo GLEventListener showing ↵Sven Gothel2013-09-104-25/+104
| | | | it's working/scaling well; Adding TileRendererBase.TileRendererNotify to RedAquareES2 having a 3rd demo case.
* Gears*: Clarify frustum calculation for tilingSven Gothel2013-09-102-4/+4
|
* NewtCanvasAWT: Implement AWTPrintLifecycle and hence support for AWT printing.Sven Gothel2013-09-081-0/+241
| | | | | | | | | Note: Same bug existing as w/ GLCanvas, i.e. 'GLDrawableUtil.swapGLContextAndAllGLEventListener(gladPre, gladNew)': If 'gladPre' is onscreen and using MSAA (on NV/GLX), the ctx cannot be made current in it's new 'gladNew' location. Same workaround applied, i.e. use onscreen drawable while printing.
* TiledPrintingAWTBase/doc: Add description of how-to add a 'print-to-file' ↵Sven Gothel2013-09-081-13/+33
| | | | printer driver on OSX
* TileRenderer*: Fix pre-swap and post-swap in regards to endTile(..), i.e. ↵Sven Gothel2013-09-081-16/+56
| | | | pre-swap only for FBO && MSAA. See TileRendererBase.reqPreSwapBuffers(..) API doc.
* Test: Don't resize frame, tweek print-matrix; AWTPrintLifecycle: Add scale ↵Sven Gothel2013-09-083-143/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* TiledPrintingAWTBase: Fix scaling - Fit frame to page, add MSAA ↵Sven Gothel2013-09-074-205/+293
| | | | | | | | | | | | | | RenderingHints test; setupPrint(Graphics2D): Query RenderingHints to use MSAA rendering - AWTPrintLifecycle.setupPrint(Graphics2D): Query RenderingHints to use MSAA rendering - Impl. in GLCanvas - TODO GLJPanel (would need a new offscreen buffer) - TiledPrintingAWTBase: - Fix scaling - Fit frame to page - add MSAA RenderingHints test - GLCanvas: Remove dumpStack() DEBUG output
* TileRenderer*: Fix FBO MSAA use-case, i.e. call swapBuffers() before ↵Sven Gothel2013-09-076-41/+187
| | | | | | | | | | | endTile(); Enhance unit tests for MSAA, also add TileRendererBase.TileRendererNotify to GearsES2 GL[Auto]Drawable.swapBuffers() must be called before endTile(). This is especially important if using multisampling offscreen FBO drawables, where swapBuffers() triggers the <i>downsampling</i> to the readable sampling sink. Otherwise, we will be 'one tile behind' !
* Complete commit 54dcdf1f53c9fc1f7124cf77bbf5aa952d42053a, exposing GL2ES3 in ↵Sven Gothel2013-09-075-15/+16
| | | | GLProfile (just a query, no new profile)
* TestTiledPrintingGears*AWT: Add 4s delay before closing frame and ending ↵Sven Gothel2013-09-063-9/+5
| | | | | | unit test to wait for print-job (?) .. otherwise results are cut-off .. better solution ? callback ?
* GLCanvas Printing WIP: Add GLJPanel; GLCanvas TILE_SIZE 512; ↵Sven Gothel2013-09-064-13/+249
| | | | print(Graphics): Don't force on AWT-EDT -> Deadlock; releasePrint(): perform reshape/display!
* Add AWTPrintLifecycle interface describing impl. w/ ↵Sven Gothel2013-09-062-257/+315
| | | | setupPrint()/releasePrint(), modularize unit test TestTiledPrintingGearsAWT
* TestTiledPrintingGearsAWT: Perform AWT mods on AWT-EDT, always perform ↵Sven Gothel2013-09-061-13/+23
| | | | g.scale(..), pass 'offscreen' w/ manual printing as well
* GLCanvas Printing WIP: Perform all print* operations on AWT-EDT, clip before ↵Sven Gothel2013-09-061-26/+76
| | | | drawing image and show same; Test: Add offscreen print and add borders.
* GLCanvas Printing WIP: Swap to offscreen at setupPrint(); Use TileRenderer @ ↵Sven Gothel2013-09-061-57/+147
| | | | | | | | | | | | | | | | | | | | | | | | print(..); Test: Add auto-print w/o UI 72dpi and 300dpi NOTE: Tile raster is added at print plus lots of debug output - WIP! - Swap to offscreen at setupPrint() - Swap GLEventListener (GLEL) and GLContext to fixed size offscreen GLAutoDrawable (GLAD) - Destroy onscreen drawable/context - Setup TileRenderer w/ offscreen GLAD - @ releasePrint() restore onscreen .. This shall ensure we don't hog the GPU resources when resizing the AWT component (upscaling). - Use TileRenderer @ print(..) The clip-rect will be used as the TileRenderer's image-size and we perform a whole tile-rendering loop. This helps to limit resources, see above. - Test: Add auto-print w/o UI 72dpi and 300dpi
* TileRendering / Gears: Clarify PMV math, if tiling use white background (-> ↵Sven Gothel2013-09-061-6/+14
| | | | print)
* TileRenderer*: TileRenderer adds setTileOffset(..), getParam(pname) shall ↵Sven Gothel2013-09-061-1/+2
| | | | | | | | | | | | | | | | | | | always return last result, no overloading of attachToAutoDrawable(..); Fix comments TileRenderer: - adds setTileOffset(..) A tile offset might be required, i.e. via a given rectangular clip bounds - getParam(pname) shall always return last result Even when finished tiling, the last value shall be returned, otherwise a post endTile() is unable to retrieve the value. - No overloading of attachToAutoDrawable(..) No reason to complicate usage by mutating semantics, call setTileSize(..) manually TileRendererBase: - Fix API doc: TR_CURRENT_TILE_X_POS, TR_CURRENT_TILE_Y_POS
* Add TestGLContextDrawableSwitch02AWT: Test AWT GLCanvas <-> ↵Sven Gothel2013-09-051-0/+192
| | | | GLOffscreenAutoDrawable switch, forth & back
* TestTiledPrintingGearsAWT: Fix margin translate for high dpi, i.e. other ↵Sven Gothel2013-09-051-6/+11
| | | | than 72dpi
* GLCanvas Printing WIP - Add TestTiledPrintingGearsAWTSven Gothel2013-09-051-0/+302
|
* TileRendererBase: Add interface TileRendererNotify, to notify implementing ↵Sven Gothel2013-09-055-18/+13
| | | | | | | | | | | | | GLEventListener about attached/detached TileRenderer .. since GLEventListener's reshape(..) method must query certain tile renderer attributes (tile pos and image size), they have to be aware of the TileRendererBase. To simplify such awareness and hence automate this attachement and passing over the tile renderer reference, they should implement this new interface. Gears example implements the new interface, which caches the TR reference and pauses rotation.
* TileRendererBase: Add toString(), Proper tile unit test names, i.e. add NEWT ↵Sven Gothel2013-09-054-14/+10
| | | | for UI agnostic (no-awt tests).
* TileRenderer*: Enhance API Doc; Cleanup OO; Remove PMVMatrixCallback, use ↵Sven Gothel2013-09-055-207/+568
| | | | | | | | | | | | | GLEventListener reshape(..) or manual reshape after beginTile(..) method. GLEventListener reshape(..) method should be aware of TileRenderer usage and get the missing tile position and image size from it (-> see Gears example). TestRandomTiledRendering3GL2AWT demos AWT GLCanvas onscreen being used for random tile rendering to produce a PNG file. TestTiledRendering1GL2 is now GLAutoDrawable/GLEventListener agnostic, hence demos plain GLDrawable tile rendering usage.
* TileRenderer*: Align impl. to common abstract superclass TileRendererBase ↵Sven Gothel2013-09-043-9/+9
| | | | (cleanup / API doc)
* TileRenderer: Unify TileRenderer, add RandomTileRenderer (both utilizing ↵Sven Gothel2013-09-045-307/+489
| | | | GLPixelBuffer, and pre/post GLEventListener)
* Cleaned up TiledRenderer capable to be used w/ GL2ES3 and TiledRenderer2 to ↵Sven Gothel2013-09-032-0/+307
| | | | | | | | | | | | | | be used w/ GLAutoDrawable. - Remove GL2 dependencies - Only requires PixelStorage ROW_LENGTH -> GL2ES3 - Position target buffer position according to skip [pixels, rows] - Use an interface PMVMatrixCallback, allowing user to reshape the custom 'PMV Matrix' according to the current rendered tile - Properly adjust tile/image buffer to written position and flip for read operation
* Gears: Make rotation optionalSven Gothel2013-09-031-2/+7
|
* X11GLXDrawableFactory.Shutdown: Disable shared context destruction since it ↵Sven Gothel2013-09-021-3/+3
| | | | | | | | | may lead to a JVM freeze .. .. on ATI fglrx driver 32bit on 64bit w/ a frozen shared GL context involved. Hence we have to rely on the driver cleanup when JVM hits 'exit', equal to the Windows implementation.
* Animator/GLWindow: Catch 'ThreadDeath/Throwable' and dump info in DEBUG mode ↵Sven Gothel2013-09-021-6/+11
| | | | (cosmetic change only); Typo in comment; TestSharedContextListNEWT2: Stop animator.
* Add '@FixMethodOrder(MethodSorters.NAME_ASCENDING)' to all *Test* classes; ↵Sven Gothel2013-09-02218-6/+658
| | | | | | | | Relying on junit 4.11 + hamcrest 1.2 (deployed in Gluegen junit.jar) See gluegen commits: - 10a28c860bd3f4ccecef156c9bbbc88087bf568d - 70c9ba258c5ba3d78f0f52faf37d88b4c62d0c96