summaryrefslogtreecommitdiffstats
path: root/doc/Implementation/AWTPrinting.txt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-06 19:58:35 +0200
committerSven Gothel <[email protected]>2013-09-06 19:58:35 +0200
commit4840117d274f9042fc6528722c1af157ad36384e (patch)
tree8b5e99d774e0af96677f0a3558e50d692d9fef5e /doc/Implementation/AWTPrinting.txt
parentc527f824d7769dac07ff3e064f216fb664742494 (diff)
Added AWTPrinting document ..
Diffstat (limited to 'doc/Implementation/AWTPrinting.txt')
-rw-r--r--doc/Implementation/AWTPrinting.txt53
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/Implementation/AWTPrinting.txt b/doc/Implementation/AWTPrinting.txt
new file mode 100644
index 000000000..0be3848ed
--- /dev/null
+++ b/doc/Implementation/AWTPrinting.txt
@@ -0,0 +1,53 @@
+Screenshots of unit tests:
+<http://jogamp.org/files/screenshots/printing/test01-awt/>
+
+Unit test producing the results:
+<http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java;h=71b4a958b1b0b34fb6c07585773ec3653c861e88;hb=de538efc92346cada023a6045d8aec3cbdd47e08>
+
+GLCanvas Print code:
+ <http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/javax/media/opengl/awt/GLCanvas.java;h=02e6e8121f2f6b6043d9513b5547ecd0e8787db8;hb=de538efc92346cada023a6045d8aec3cbdd47e08#l739>
+
++++
+
+Enhance lifecycle for AWT printing via AWTPrintLifecycle:
+
+Low-res print at 72dpi leaves the frame untouched,
+where high-res print at 300dpi increases the frame size
+to the reverse scale-factor.
+
+Before printing and optional resize, we setup the GLCanvas:
+ - move GLContext and GLEventListener -> offscreen
+ - destroy onscreen component w/ size equals of tile-size
+ This steps allows us to ensure we use limited GPU resources.
+this is done w/ setupPrint().
+Impl. in GLCanvas, etc.
+
+After printing, releasePrint() shall be called. Impl. in GLCanvas .. etc.
+
++++
+
+Tiled rendering is used, i.e. at print(Graphics g),
+the clip bounds is used to setup the TiledRenderer's
+image size and the impl. renders all tiles.
+
+For the tiled reshape, a user component,
+i.e. GLEventListener reshape(x, y, width, height),
+needs to know about the current tile's position and image size.
+The tile size itself is passed as width and height
+as this is being used to set the current viewport.
+
+Hence the GLEventListener shall implement the
+TileRendererBase.TileRendererNotify interface!
+
++++
+
+Screenshots/Bugs:
+
+You see the black raster, which shows each rendered tile.
+
+As you can see, we have different results w/ onscreen and offscreen
+AWT printing. Both expose bugs regarding layout/scale of the AWT components.
+
+It would be interesting to learn what I am doing wrong w/ the printing setup
+or GLCanvas rendering at print.
+