From 4840117d274f9042fc6528722c1af157ad36384e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 6 Sep 2013 19:58:35 +0200 Subject: Added AWTPrinting document .. --- doc/Implementation/AWTPrinting.txt | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/Implementation/AWTPrinting.txt (limited to 'doc/Implementation/AWTPrinting.txt') 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: + + +Unit test producing the results: + + +GLCanvas Print code: + + ++++ + +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. + -- cgit v1.2.3