From efa8a7927eb8c69e45787d15306e172e440c6150 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 15 Sep 2013 23:46:35 +0200 Subject: Updating doc AWTPrinting.txt --- doc/Implementation/AWTPrinting.txt | 20 ++++++++++++++------ .../jogamp/nativewindow/awt/AWTPrintLifecycle.java | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/Implementation/AWTPrinting.txt b/doc/Implementation/AWTPrinting.txt index 97353266e..f2fcbbdd9 100644 --- a/doc/Implementation/AWTPrinting.txt +++ b/doc/Implementation/AWTPrinting.txt @@ -11,7 +11,7 @@ Unit test producing the results: Print code: AWTPrintLifecycle: - + GLCanvas: ... @@ -41,20 +41,28 @@ Impl. in GLCanvas, etc. After printing, AWTPrintLifecycle.releasePrint() shall be called. Impl. in GLCanvas .. etc. -To perform AWTPrintLifecycle on all component in one container, +To perform AWTPrintLifecycle on all components in one container decorating PrinterJob.job(), one may use: - final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, g2d, scaleGLMatXY, scaleGLMatXY); + Container cont; + double scaleGLMatXY = 72.0/glDPI; + int numSamples = 0; // leave multisampling as-is + PrinterJob job; + ... + final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(cont, scaleGLMatXY, scaleGLMatXY, numSamples); try { AWTEDTExecutor.singleton.invoke(true, new Runnable() { public void run() { - frame.printAll(g2d); + try { + job.print(); + } catch (PrinterException ex) { + ex.printStackTrace(); + } } }); } finally { ctx.releasePrint(); } - +++ Tiled rendering is used, i.e. at print(Graphics g), @@ -75,7 +83,7 @@ TileRendererBase.TileRendererNotify interface! Bugs: - None in results - - GLCanvas: Workaround bug where onscreen MSAA cannot switch to offscreen FBO, + - GLCanvas: Workaround Bug 830 where onscreen MSAA cannot switch to offscreen FBO, i.e. stay 'onscreen' +++ diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java index a54f6bac6..65e5ab3f0 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java @@ -51,7 +51,6 @@ import jogamp.nativewindow.awt.AWTMisc; * on all {@link AWTPrintLifecycle} elements in the {@link Container}.
* To minimize this burden, a user can use {@link Context#setupPrint(Container, double, double, int) Context.setupPrint(..)}: *
- *  Graphics2D g2d;
  *  Container cont;
  *  double scaleGLMatXY = 72.0/glDPI;
  *  int numSamples = 0; // leave multisampling as-is
-- 
cgit v1.2.3